VirtualBox: Bits and Bytes Masquerading as Machines
Because I opted for the personal evaluation binary, I had to accept the PELA and fill in a quick registration at first launch.
There are two parts to creating any virtual machine: the creation of the virtual machine container and then the installation of the OS into that container. To do the first part, start VirtualBox and click the New icon. This opens up the New Virtual Machine Wizard (Figure 2).
First, you must name your virtual machine. I know from experience that I will create many, many virtual machines, so I have opted to name them each as the OS and then its function. In this case, I want to see whether I can run our podcasting rig out of a VirtualBox virtual machine, so I'm going to install dyne:bolic into my virtual machine. Therefore, I name this virtual machine Dynebolic-Podcasting and select the Linux 2.6 kernel OS (Figure 3).
Like a physical machine, a virtual machine needs some RAM. On the next screen, the wizard suggests 256MB of RAM. However, because I know that crunching a big Ogg file can take a system to its knees, I allocate 512MB to this virtual machine (Figure 4).
What does the virtual machine need next? Well, just like a regular machine, it needs a hard drive. I know from experience that I can use a CD/DVD ISO file (like my friendly dyne:bolic ISO) as the bootable hard drive, but VirtualBox's new machine wizard doesn't allow for that. I will be able to add my ISO later on, but not right now. So, as counter-intuitive as it seems, simply click the Next button without setting up any disks and acknowledge the error dialog that tries to stop this folly (Figure 5). Click Finish, and voilà, you have a shiny new dyne:bolic virtual container.
Sadly, this virtual machine will not boot, because I still don't have a hard drive or other bootable media. I want this thing to boot the dyne:bolic ISO image I have stored on my hard drive, so I have to mount a virtual CD/DVD drive into my virtual machine. This is one area where virtual and physical machines differ. If this were a physical machine, I would not only have to attach a CD/DVD drive to the machine, but I also would have to insert my dyne:bolic CD into the drive for the machine to boot in to it. With a virtual machine, I merely point to the ISO image, and VirtualBox is smart enough to understand that it is to boot from it. To accomplish this rather unintuitive task, follow these steps from the main VirtualBox screen:
Highlight the virtual machine you just created.
Click the blue CD/DVD-ROM label in the right column.
Click the Mount CD/DVD Drive check box (Figure 6).
Click the ISO Image File check box.
Click the file folder browse icon next to the ISO Image File drop-down list box.
Click the Add button and browse for your ISO image (Figure 7).
Note that the screen from Step 2 above also provides the interface to add all sorts of ports and storage devices to the virtual machine. I'm happy running my dyne:bolic as a live CD, but if I wanted to install it into this virtual machine, I would have to create a hard drive into which to install it.
There are two types of hard drives in the virtual world: those that take up all the space they are allocated right off the bat, and those that can grow into their maximum allocated size as needed. I'm a big fan of the second type, because it allows me to allocate large amounts of disk space to my virtual machines without fearing that I will lose all that space from my host machine right away.
To create a growable hard disk, get yourself back to the main VirtualBox interface and ensure that the virtual machine is shut down. Then, follow these steps:
Highlight the virtual machine to which you want to add a drive.
Click the blue Hard Disks label in the right column.
To add a primary master drive, select the Primary Master check box.
Select the file folder browse icon next to the Primary Master check box.
Click the New button.
Select the Dynamically expanding image check box, unless you have a reason to select the Fixed-size image, and click the Next button.
I recommend naming your disk file(s) with the same name as the virtual machine to which they belong. There are instances where you might want to share disks between virtual machines, and therefore this naming convention might not make sense, but for the most part, the “one-disk-one-machine” philosophy works well.
Use the Image Size slider, or type in the desired disk size (Figure 8).
Click the Next button and the Finish button, and you now have a disk for your virtual machine.
If you've done everything right, the main VirtualBox screen will show your ISO under the CD/DVD-ROM label (remember, I didn't actually create a hard disk for my machine, so it doesn't show in my screenshot—Figure 9).
|Android Candy: Copay—the Next-Generation Bitcoin Wallet||Sep 03, 2015|
|The True Internet of Things||Sep 02, 2015|
|September 2015 Issue of Linux Journal: HOW-TOs||Sep 01, 2015|
|September 2015 Video Preview||Sep 01, 2015|
|Using tshark to Watch and Inspect Network Traffic||Aug 31, 2015|
|Where's That Pesky Hidden Word?||Aug 28, 2015|
- Using tshark to Watch and Inspect Network Traffic
- Problems with Ubuntu's Software Center and How Canonical Plans to Fix Them
- The True Internet of Things
- September 2015 Issue of Linux Journal: HOW-TOs
- Android Candy: Copay—the Next-Generation Bitcoin Wallet
- Firefox Security Exploit Targets Linux Users and Web Developers
- Where's That Pesky Hidden Word?
- Concerning Containers' Connections: on Docker Networking
- A Project to Guarantee Better Security for Open-Source Projects
- Doing Astronomy with Python