The first question being, why would you want to? In my case, I use InDesign to write and typeset the books, ebooks, and manuals so that limits me to Windows or OS X. Since I have a contract to write a book about a Linux-based CAD package, that means running Linux in a virtual machine on the most convenient computer, my desktop Windows 7 computer.
Normand Chamberland of the CAD on Linux blog recommended I try Oracle's free VM VirtualBox software. I downloaded and installed it, and then found that it is pretty good for free, but has a few foibles when installing the guest operating system.
(Virtual machine software lets your computer run more than one operating system. Some developers use it to run a second copy of Windows or OS X; should the software they are writing crash "the computer," is the virtual machine that crashes, not the entire computer. Note you have to purchase the second copy of Windows. VMs are possible because recent CPUs enable this feature.)
Upon creating the first virtual machine (just click New to start the process), you are asked a few basic questions. (Read Oracle's documentation; I am envious at how well it is written.) Here are my answers:
- RAM to allocate: 768MB (my computer has 4GB)
- Hard disk space to allocate: 32GB (my computer has 1TB)
- Type of drive space: fixed (more efficient than variable; 32GB is plenty for a Linux system)
After providing these parameters, VirtualBox takes 5-10 minutes to prepare the disk space. (This will be a section of your hard drive that is walled off from the rest of the computer, although it can access folders and files on the rest of the drive, other drives, and the network.)
Installing Linux
Here is the tricky part that VirtualBox does not handle well: when you click Start to launch the newly-created VM, it begins by trying to install the guest operating system, which VirtualBox expects to be (1) on a CD or other portable disk; and (2) ready and waiting.
I was going to use the ISO file from a recent download of Ubuntu, but VirtualBox would not let me select drive C:. It went on to boot a non-existent OS anyhow -- that is to say, none.
I had to delete the VM, start over, and then specify the computer's D: drive, which now held a copy of Ubuntu that I burned to a CD. This time it almost worked; the drawback to installing from a CD is that it much slower than from an ISO file on the hard drive. After I told Ubuntu to install itself from the CD, it complained about insufficient disk space. I realized I specified just 32MB, instead of 32GB, for the hard drive.
Erase VM. Install VM again. Install Ubuntu. And it works.
Running Linux on Windows
A virtual machine has drivers to access your computer's hardware, including USB drives, the graphics board, and the network. The VM usually runs in a window, but there is an issue with the mouse's "focus."
When you work inside the VM window (using Ubuntu), you'll find that the cursor gets "locked" inside the window. With VirtualBox, you press the righ-hand Ctrl key to release the cursor to travel outside the window. These and other issues are explained by dialog boxes that pop up at the appropriate times.
(Normally, I would install Linux Mint, because it includes all non-open-source software you neeed, such as Flash. Since I was going to be writing a book, I thought I should stick with the most popular variant of Linux, Ubuntu (download here), which tries to remain pure by excluding anything that is not open source. It just meant that I needed to separately download Flash, MP3 decoders, Acrobat, etc, after Ubuntu is installed.
I installed the 32-bit version of Ubuntu v10.04, since the Linux-based CAD system is also 32-bit. If you wish to use something like ARES on a 64-bit Linux system, follow the instructions by Mr Chamberland at How-to: Installing ARES Commander Edition on Ubuntu 10.04 LTS 64-bit.)
Running CAD/Linux on Windows
Wow! Ubuntu boots fast: 18 seconds, including the time to launch the VM.
Figure 1: Firefox running on Ubuntu inside the VM window on Windows 7; to the left is the VirtualBox control panel.
My final installation step was to install the CAD package. This is completely straight-forward, if you are familiar with modern-day installs of software on Linux.
The CAD vendor has package files for a variety of dialects of Linux:
- Suse, Mandiva, Fedora -- RPM file
- Ubuntu, Debian -- DEB file
- Other distributions -- TAR.GZ file
I picked the Ubuntu/Debian file (Ubuntu is based on Debian, and Linux Mint is based on Ubuntu).
One thing missing from Oracle's free VM that it does not allow copy'n paste between the VM and the host OS -- as does Parallels (which I run on my MacBook). I can do screen grabs of the entire VM window, which I then need to trim.
If you install the Guest Additions (under the Devices menu) to the Virtual Box, the integration with the Host OS is a little nicer, no more mouse capture, full screen mode, plus some other little tricks.
Posted by: Mike R | Oct 06, 2010 at 04:28 AM
You can set VirtualBox's CD-ROM drive to an ISO image (though to install on OS, it would have to be a bootable ISO image).
The easiest way to run Linx on VB is to look for pre-made VirtualBox images with the Linux distro of your choice (I'm sure they exist for Ubuntu).
Posted by: Tony | Oct 06, 2010 at 07:48 AM