Windows 10 on Ubuntu 20.04 with VirtualBox

It is tax season again in Canada. In the past I had a VirtualBox virtual machine that I would only bring up for the purpose of running the Windows version of TurboTax because the member of our family who files the taxes dislike the too simplified online version.

Unfortunately VirtualBox refuses to come up on macOS BigSur due to new security considerations enforced by macOS. The new System Integrity Protection (SIP) disallows the kernel extension required for VirtualBox. Instead of going around SIP via the crsutil disable command, I decided to move all of my virtual machines that is currently sitting on my Mac to my Ubuntu NAS, since the Ubuntu box is up 24 x 7 and should be more convenient.

Below is what I had to do on my Ubuntu 20.04.2 LTS server.

Add the apt source where we can get VirtualBox.

sudo wget -q https://www.virtualbox.org/download/oracle_vbox_2016.asc -O- | sudo apt-key add -

echo "deb [arch=amd64] https://download.virtualbox.org/virtualbox/debian focal contrib" | sudo tee /etc/apt/sources.list.d/virtualbox.list

sudo apt update

Install Virtual Box and our user to the vboxusers group.

sudo apt install --yes virtualbox-6.1
sudo systemctl status vboxdrv

sudo usermod -aG vboxusers $USER

We then need to install the extension that enables RDP. The virtual machine is going to be hosted on a server without a graphics user interface, so we have to use a Remote Desktop Client (from Microsoft) on another machine (e.g. my Mac) to gain access.

VBOXVER=`vboxmanage -v | cut -dr -f1`
wget -P /tmp \
https://download.virtualbox.org/virtualbox/$VBOXVER/Oracle_VM_VirtualBox_Extension_Pack-$VBOXVER.vbox-extpack

vboxmanage extpack install /tmp/Oracle_VM_VirtualBox_Extension_Pack-$VBOXVER.vbox-extpack

I tried to import my existing Windows VM without much success, so I decided to create a new one from scratch and reinstalled Windows 10 Pro.

vboxmanage createvm --ostype Windows10_64 --basefolder "/home/kang/VirtualBox" --register --name "win10"

vboxmanage modifyvm "win10" --memory 4096 --nic1 bridged --bridgeadapter1 em1 --vrde on --vrdeport 3389

vboxmanage createhd --filename "/home/kang/VirtualBox/win10/win10.vdi" --format VDI --size 100000

vboxmanage storagectl "win10" --name "SATA" --add sata

vboxmanage storageattach "win10" --storagectl SATA --port 0 --type hdd --medium "/home/kang/VirtualBox/win10/win10.vdi"

vboxmanage storageattach "win10" --storagectl SATA --port 15 --type dvddrive --medium /home/kang/VirtualBox/en_windows_10_consumer_editions_version_2004_updated_feb_2021_x64_dvd_f42b7d6d.iso

vboxmanage storageattach "win10" --storagectl SATA --port 14 --type dvddrive --medium /home/kang/VirtualBox/VBoxGuestAdditions_6.1.18.iso

Note that I had to pre-download the Windows 10 ISO and VBoxGuestAdditions ISO files. The guest additions iso file was available from this site.

https://download.virtualbox.org/virtualbox/6.1.18/

For some reason my motherboard did not have the cpu virtualization mode enabled, so I had to do that with my BIOS settings. It was cryptically called AMD SVM (secure virtual machine).

I started the virtual machine with:

vboxmanage startvm win10 --type headless

However, I had issues with remote desktop. I had to set some permissions with the VirtualBox extensions. The following commands were executed to create a user and its password for Remote Desktop access.

vboxmanage shutdown win10 

vboxmanage setproperty vrdeauthlibrary VBoxAuthSimple

vboxmanage modifyvm "win10" --vrdeauthtype external

vboxmanage internalcommands passwordhash YOUR_PASSWORD
Password hash: 1ffc0406b9891fcd265a225e83a668fa045f1282588f80c8d11c029bad156d85

vboxmanage setextradata "win10" "VBoxAuthSimple/users/tax" 1ffc0406b9891fcd265a225e83a668fa045f1282588f80c8d11c029bad156d85

Now, I can access the VM through Remote Desktop from my Mac. I continue through the process of installing Windows 10, and the VirtualBox guest additions.

The rest is pretty simple. Install Chrome, Buy TurboTax for 2020 tax year, and we are all set!

One final note, I shared a macOS folder to the VM using normal SMB protocol, so that once my taxes are completed, this VM is a throw away, until next year!

The Day After: Installed a security update in regards to virtualbox-dkvm and VirtualBox now refuses to boot from any bootable iso. I gave up and used Parallels on my MacBook Pro. I may try kvm later.

Leave a Reply

Your email address will not be published. Required fields are marked *