Basic Linux Virtualbox Guest on Windows Host
Essential steps to create a new Linux guest instance on a Windows host OS using VirtualBox and VirtualBox Guest Additions.
- You have a working and up to date VirtualBox host running, likely on Windows
- VirtualBox guest additions are downloaded to some logical permanent spot
- Linux installation ISO of your choice downloaded at the ready.
Consider how you may use this new VM when choosing maximum VDI disk space allocation. Current Linux Mint for example says it wants 10GB to install, although by the time install and updates are done it will have used approximately 6GB only.
If you might want to later clone this new VM to a 16GB thumbdrive, perhaps allocate 12GB - 14GB of virtual disk to leave some wiggle room for later.
Add a new machine to VirtualBox; the type should reasonably match the OS you are installing; some options may not be checked or need adjusting later. Video RAM is a common one; I generally jack it up to max. PAE may need to be selected. YMMV. Create the 12 GB VDI.
Attach your downloaded Linux installation ISO as the first optical drive and then start the virtual machine and proceed through the Linux OS initial install.
Restart; check that your install ISO is no longer attached - you want to be certain that the changes you now make will persist.
Install some basics for building Linux applications; VB Guest Additions needs this support. Run as root or
sudo apt-get install -y dkms build-essential linux-headers-generic \ linux-headers-$(uname -r)
In the host OS (i.e. Windows) mount the VB Guest Additions ISO as an optical drive. In the guest OS (i.e. Linux) the drive should now be available at a mount point, likely under
Install Guest Additions:
cd /media/username/VBox_GAs_n.n.n # whatever the version ./VBoxLinuxAdditions.run
After the build procedure completes, restart.
If on restart there is no information box overlaying your new Linux workspace warning about video hardware acceleration missing, that’s a good sign that Guest Additions was built, installed and is active. A quick sanity check to see if the kernel modules for VirtualBox are loaded:
$ lsmod | grep vbox vboxsf 45056 0 vboxvideo 36864 2 ttm 90112 1 vboxvideo drm_kms_helper 139264 1 vboxvideo drm 303104 5 vboxvideo,ttm,drm_kms_helper vboxguest 241664 7 vboxsf syscopyarea 16384 2 vboxvideo,drm_kms_helper sysfillrect 16384 2 vboxvideo,drm_kms_helper sysimgblt 16384 2 vboxvideo,drm_kms_helper
At this point you can enable some useful features made possible by Guest Additions, if they aren’t already enabled, such as shared (bi-directional) clipboard. From the pop-up menu at the bottom, or hit the “host key” for VirtualBox (right Alt-F) if necessary, and choose the Devices / Shared Clipboard menu.
You’ll want to do the usual post-OS install:
sudo apt-get update sudo apt-get upgrade
In a separate article we’ll take this Linux instance and move it to a USB Thumbdrive and make it bootable - no VirtualBox needed.