Basic Linux Virtualbox Guest on Windows Host

Posted in howto; tagged with linux, virtualbox

Essential steps to create a new Linux guest instance on a Windows host OS using VirtualBox and VirtualBox Guest Additions.

Assumes:

  1. You have a working and up to date VirtualBox host running, likely on Windows
  2. VirtualBox guest additions are downloaded to some logical permanent spot
  3. Linux installation ISO of your choice downloaded at the ready.

Getting going:

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.

  1. 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.

  2. 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.

  3. Restart; check that your install ISO is no longer attached - you want to be certain that the changes you now make will persist.

  4. Install some basics for building Linux applications; VB Guest Additions needs this support. Run as root or sudo:

    sudo apt-get install -y dkms build-essential linux-headers-generic \
                            linux-headers-$(uname -r)
  5. 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 /media or /media/username/....

  6. Install Guest Additions:

    cd /media/username/VBox_GAs_n.n.n # whatever the version
    ./VBoxLinuxAdditions.run
  7. After the build procedure completes, restart.

    sudo reboot
  8. 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
  9. 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.

  10. You’ll want to do the usual post-OS install:

    sudo apt-get update
    sudo apt-get upgrade

Done.

In a separate article we’ll take this Linux instance and move it to a USB Thumbdrive and make it bootable - no VirtualBox needed.