Version 3 (modified by 9 years ago) ( diff ) | ,
---|
Getting Started Testing with Linux virtual machine on Windows host
Boost developers using Windows as their development platform may occasionally wish to run local tests on Linux, too. A Linux virtual machine running on the developer's Windows host machine is an easy and free way to do just that. A Linux or Mac developer could do the reverse, although doing so would require a Windows license be purchased, but this article is limited to the Linux on Windows case because that's what I'm familiar with.
Likewise, the article is limited to VirtualBox because that's the virtual machine manager I use. It was free, ease to install and use, and worked better for me than several similar packages. But that was some years ago and your mileage may vary.
VirtualBox and Ubuntu both have excellent installation instructions, but if they are new to you it still takes a while to figure out the various choices. The hope in documenting my personal installation process is to get you started quickly.
Initial downloads and installation
- Download the Ubuntu Desktop installer, choosing the 64-bit flavor unless you have less than 2GB of RAM. The
.iso
file downloaded will be used later. - Download the !VirtualBox installer for Windows hosts.
- Run the VirtualBox installer, selecting the default when offered a choice.
Create a new virtual machine
- Run VirtualBox. Click the New button to create a new virtual machine. My host machine has four cores with hyper-threading and 16GB of main memory, so I give the virtual machine 2GB of main memory. I also give it 20GB maximum of disk space - VirtualBox only allocates that much if actually needed.
- Once the virtual machine has been built, click Settings (gear icon) and set:
- System: Processor: 2 CPU's.
- General: Advanced: Shared clipboard: bidirectional
- General: Advanced: Drag'n'drop: bidirectional
If you want to change any of the features of the virtual machine at a later time, you can do so via Settings.
Install Ubuntu on the virtual machine
- Select the virtual machine, it it isn't already selected.
- Click Start. When asked to specify a startup disk, browse to your download folder and select the Ubuntu
.iso
file you downloaded earlier. It will have a name similar toubuntu-13.10-desktop-amd64.iso
, except the version number and machine architecture may differ. - If a message about mouse integration appears, you probably want to check "Do not show message again".
- When the desktop appears, select "Install Ubuntu".
- Check the box: Download updates while installing.
- Check the box: Install this third-party software.
- Hit "Continue", "Install now", and then other than entering your name and the computer name, just keep accepting the defaults. But you probably want to choose "Log in later" for Ubuntu One
At this point, the install starts to run. It does quite a bit of downloading files, and one or two times I have had hangs almost certainly related to network problems or overloaded servers. When that happened I verified the md5 checksum for the Ubuntu .iso
file, removed the virtual machine from VirtualBox and just started over. But usually everything goes smoothly.
Post installation restart and VirtualBox Additions install
- A Ubuntu restart is required after the install finishes. Sometimes the post-install shutdown requires hitting Return (aka Enter).
- After the post-install shutdown, start the virtual machine again.