I installed VirtualBox from here: https://www.virtualbox.org/wiki/Downloads on macOS 10.13.3 and I am an admin on the computer. When I try to run the application it does not start. I tried to reinstall the application, but nothing changed. What am I doing wrong?
VirtualBox doesn’t start on MacOS High Sierra
high sierravirtualbox
Related Solutions
I had a need to do this today and I saw your question, so here is a protocol of the steps I took.
Find the Device Number
diskutil list
e.g. 2, as in /dev/disk2
Assuming 2
for the rest of the instructions.
Create the Virtual Machine VMDK
VBoxManage internalcommands createrawvmdk -filename "$HOME/dev-disk2.vmdk" -rawdisk /dev/disk2
Eject the device before this step, otherwise you will get an error: VERR_RESOURCE_BUSY
. You may want to add an entry in fstab
with the added parameters noauto
to prevent the OS from remounting the drive.
I use rdisk-disk2.vmdk
for the name, because this virtual machine is just a pointer to this device. After reboot, the situation could change e.g. a device might be assigned a different number especially if you unplug things and move things around.
Start Virtual Box Manager with Root Privileges
sudo /Applications/VirtualBox.app/Contents/MacOS/VirtualBox
Because devices are all owned by root, you need to start VirtualBox with root privileges. This has consequences. Your home context (home folder and preferences) will be changed to root. Your other virtual machines will not be visible. If you open a file browser, you will see the root's home folder by default.
Another option is to change the permissions of the device (not recommended) as you have done.
To confirm permissions of devices, you can run ls -l /dev/disk*
- Add New Machine, provide name: /dev/disk2, type: linux, version: arch linux (64-bit)
- Give it some memory (whatever you can)
- Select existing drive using VMDK created above. (IMPORTANT ensure the drive has not been remounted, otherwise you will get
VERR_RESOURCE_BUSY
,NS_ERROR_FAILURE
)
Install a Fresh System
Add an optical disk file (e.g. a bootable linux ISO of your liking) and turn on the Live CD/DVD optional so that you boot from it.
Make System Bootable in VirtualBox
This is not so obvious, especially if you use an EFI setup. If using grub-mkconfig
, the name of the efi file is grubx64.efi (assuming 64 bits). VirtualBox is finicky about where it looks for a boot file. The default will not do.
Rename grubx64.efi
to bootx64.efi
/boot/EFI/BOOT/bootx64.efi
Notes
- tip: get yourself iterm 2
- This is super useful for Macbooks when installing Arch Linux, because the default ISO does not load the wlan card drivers.
I also followed the guide at http://web.archive.org/web/20181103074214/http://danielphil.github.io/windows/virtualbox/osx/2015/08/25/virtualbox-boot-camp.html
I will add what challenges I had following that guide, but I was able to run my BOOTCAMP partition using VirtualBox, which is free, so I'm happy.
First, you should have installed:
- Windows 10 x64 using the OS X Boot Camp assistant
- VirtualBox 5.0.26 r108824
I also downloaded:
- VBoxGuestAdditions_5.0.26.iso (I don't think this is necessary, but I did it just to be safe)
As far as Disabling SIP or System Integrity Protection on El Capitan (OS X 10.11), I skipped that part. It was not necessary in my case.
As far as setting drive permissions:
- I ran
diskutil list
to get a list of drives on my system, taking note of the drive number of the drive namedEFI
and the other one namedBOOTCAMP
, which in my case, theEFI
drive was 1 and theBOOTCAMP
drive was 4. I then ran the instructions to unmount my Bootcamp drive and set permissions so that VirtualBox could access the drive. According to danielphil, this needs to be performed each time one reboots.
diskutil unmount /Volumes/BOOTCAMP
sudo chmod 777 /dev/disk0s1
<--- This is the drive no. of the EFI disksudo chmod 777 /dev/disk0s4
<--- This is the drive no. of the BOOTCAMP disk
As far as creating the VirtualBox image, the instructions are:
Run the following commands to create a VirtualBox disk image wrapper for >your HD. Substitute the 1,4 with the numbers of your EFI and BOOTCAMP >partitions as appropriate and put your OS X username in for >your_username_here. Make sure you are in the directory where you want to store the VirtualBox image, or you will have to move it later.
sudo VBoxManage internalcommands createrawvmdk -rawdisk /dev/disk0 -filename win10raw.vmdk -partitions 1,4
sudo chown your_username_here *.vmdk
As far as creating the VM, the guide was not so clear. Before I followed the instructions from the screenshots, I created a new virtual machine in VirtualBox, checking "Do not add a virtual hard disk".
Once created, I selected it and clicked on "Settings". At this point, I followed the screenshots in the guide. The only difference was that:
- I did NOT check "Enable EFI (special OS only)"
- I did NOT have the option to check "Enable VT-x/AMD-V"
- I used the recommended base memory of 2048 MB, as I only have 8GB of memory
- In the "Storage" tab under "Storage Tree", I had to:
- click the "adds optical drive" icon under Controller:SATA to add the "VBoxGuestAdditions_5.0.26.iso" file I downloaded.
- remove the "empty" image under Controller:SATA
- Select the "Add IDE Controller" icon at the bottom
- click the "adds hard disk" icon under Controller:IDE to add the vmdk file created
Related Question
- MacOS – VirtualBox 5.1.28 fails to install on MacOS 10.13 due to KEXT security
- MacOS – Can’t install El Capitan in VirtualBox on High Sierra
- Mac – How to change the environment variables for VLC on macOS High Sierra
- MacOS High Sierra python3 / pip awscli install path confusion
- IMac – Problem installing High Sierra 10.13.4
- MacOS – Cannot enable FileVault on macOS High Sierra
Best Answer
These two commands solved my problem:
I didn't have the right permissions.