VirtualBox: Installing a Linux Guest under a Windows Host OS
Here are some tips on installing a Linux guest VirtualBox VM under a Windows host:
- Enable VT-x/AMD-V in the system BIOS settings of your physical computer in order to run a 64-bit guest OS.
- Install VirtualBox (virtualbox.org) on your host OS.
- Download your favourite Linux distribution as an ISO file. In this book 64-bit Debian is used. Download the Net debian-jessie-DI-rc1-amd64-netinst.iso or equivalent from the page www.debian.org/releases/. Do not use the ia64 branch unless you are using a high-end Itanium-based server. Important: see note at the top of the page about Debian Wheezy.
- Start Oracle VM VirtualBox Manager and choose New. If available, give the installation 2GB+ memory. Create a virtual hard drive (VDI format, dynamic allocated) and make the size much greater than the 8GB it recommends. Choose the location on your computer to store the disk and use a minimum of 25–30GB! It is difficult to resize a disk after the fact. If you choose “dynamically allocated”, it will only occupy real disk space when you fill the Linux disk, so feel free to choose a large disk size.
- You now have a new VM that is powered off. Select it and click on settings. Under storage you should see your VDI (under SATA) and an “Empty” entry (under IDE). Select the “Empty” entry and click the disk icon under Attributes. Find and select the Linux ISO file that you downloaded, as shown in the figure below.
Figure 3-1: The VirtualBox VM configuration pane
- Start your VM and install Linux by booting off the virtual drive. If you see a message “No Boot Device,” go to Settings System and disable the floppy drive.
- Once your guest OS is running, choose Devices Install Guest Additions from the menu bar of your VirtualBox window. If all goes well, you will now be able to resize the window and cut-and-paste text between the host and guest OSs (by enabling Devices ⇒ Shared ⇒ Clipboard Bidirectional).
- Choose “Devices”->”Insert Guest Additions CD image…”
- If the guest additions do not install automatically, follow these steps (for Debian desktop — tested on Wheezy and Jessie images) in a terminal window:
molloyd@debian:~$ su -
root@debian:~# apt-get update
root@debian:~# apt-get install build-essential module-assistant
root@debian:~# m-a prepare
root@debian:~# cd /media/cdrom
root@debian:~# sh ./VBoxLinuxAdditions.run
- With your network settings set as NAT on Adapter 1 (default setting) you should now be able to ping 192.168.7.2 (your BBB when using Internet-over-USB), or its equivalent network IP address (if connected by regular Ethernet).
If you go to the VirtualBox System ⇒ Processor settings, you will see the number of cores that can be allocated to the guest OS. On an Intel i7 processor you will see either 16 or 24 as the upper limit, depending on your exact processor. On a 4-core processor, you will see one core per thread, so 8 “real” cores, and you will also see that number again in “virtual” cores. Do not use virtual cores, as they will be provided through time slicing and your machine may slow down considerably. The maximum number of cores you should allocate to your guest OS is the total number of real cores minus one.
VirtualBox: Useful Tools – Cairo Dock
The latest windowing interface for Debian Jessie contains some very nice features, but it is quite lean. One tool that is useful and will be familiar to Mac OS X users is the Cairo Dock. It is illustrated in Figure 2-A2 below. You can install it using the following step:
molloyd@DebianJessieVM:~$ sudo apt-get install cairo-dock
Figure 2-A2: The Cairo Dock in action under Debian 8 (Jessie)
Debian 8 Jessie uses Gnome 3. To start up this dock automatically on boot you can perform the following steps:
And then click “Startup Applications” on the left-hand menu. On the right-hand pane click on the “+” icon and add Cairo-Dock to the list.