![Install Linux On Virtual Machine Install Linux On Virtual Machine](http://www.psychocats.net/ubuntu/images/virtualboxprecise01.jpg)
I must admit I haven't been a huge fan of virtual machines for personal use until recently. As a Linux advocate who would take pains to convert users to Linux, virtual machines served no purpose for me. Back in 2005, the greatest challenge for Linux was hardware: wireless wouldn't work; Bluetooth might not work, graphics would give glitches and even USB devices like tablet pens refused to talk. Every time you came across a new device, you had to find drivers and wrappers to make things work.
A Linux user needed to interact with “real” hardware to find solution; a virtual machine was out of question. As a Linux journalist, I could not rely on a virtual machine to review a distro and recommend it. I needed to know how well it worked with “real” metal. Things have changed, however. Thanks to work done by kernel developers like Greg Kroah-Hartman, most hardware works out of the box on Linux. Hardware support has become less and less important and the focus has shifted to the unique features of distros.
Of late, I have become a heavy user of virtual machines, which allows me to safely play with multiple distros on the same machine and write about them. Virtual machines are used heavily in the enterprise segment, but in this article I am going to talk about advantages of virtual machines for new Linux users and how they can benefit from them. Who Needs a Virtual Machine? Many Linux users have to dual boot because they need certain proprietary software or services that are not yet available for Linux. In many countries, software needed for tax filing and other government related work is supported only on Windows. Instead of going through the complexity and pain of dual booting, you can easily use virtual machine to run Windows software. Looking at the vulnerabilities found in Microsoft Windows, I would be extremely careful with it running on my main system.
Installing Linux Mint in VirtualBox. First of all go to VirtualBox website, download and install VirtualBox. The procedure is just like installing any other software. Open VirtualBox and click on New. A new box will open. The pros for installing Linux in a virtual machine include: The ability to try a version of Linux without affecting the Windows host machine The virtual Linux operating system will perform the same way as it would when installed to the physical hard drive.
I am much more comfortable keeping Windows in a contained virtual environment. That way, even if it is compromised, it will not damage my entire system or data and will only affect the limited set of files it was accessing. I run a Windows 8.1 machine in virtual environment to perform certain tasks that couldn’t be done under Linux - although I rarely use that machine. One area where virtual machines won’t work are gaming.
You need to talk to real CPU, GPU, and RAM to get the gaming experience you want - especially if you are playing resource hungry games like Crysis. Audio and video editing won’t work either, as you don’t want a virtual layer between the application and the hardware. Beyond these and some other areas, virtual machines work great. VMs also can be useful for those non-Linux users who want to play with Linux or who want to migrate to it but don't want to jump shark by formatting the OS they were used to and switching to Linux. Virtual machines get these users comfortable with Linux, so they can make the switch with confidence when they are ready. And, you can be running Linux “inside” your shiny Mac OS X or Windows 10. The best thing about virtual machines is that I can run multiple Linux distributions on the same hardware, without having to reboot to switch between distros.
As a Linux journalist, it’s extremely important for me to run various distros and keep an eye on them. And, as a Linux user, it’s even more important to be well versed with all major distros instead of being “vendor-locked” or totally dependent on any one. Using VMs, I can also run different desktop environments on the same system without having to log out to change the environment. If you are aspiring to become a system admin or developer, you certainly don’t want to know only one distro; you must be an expert in any Linux; you never know which OS your employer or client would be using. You can’t say “sorry, I know only Ubuntu.” If you are a developer, you need different distributions to test your applications. You can clearly see that there are many advantages of using virtual machines.
The biggest advantages of using virtualization instead of multi-booting is efficiency. I used to waste way too much time in formatting hard drives and switching between distros.
With virtual machines, you can start a new virtual machine for a distro without affecting your work; it’s as easy as opening a new application. If you are a distro-hopper or enthusiast like me then a virtual machine is bliss. I am an Arch Linux user, but I keep an eye on half a dozen other distros including openSUSE, Kubuntu, Ubuntu, Fedora, Linux Mint, etc. It’s “virtually” impossible for me to have six physical machines, which waste financial resources and electricity and take up space. Instead of buying six physical machines, I would rather invest in more RAM and a multicore processor that can handle more virtual machines. Now I run almost a dozen distros (including Windows) on the same machine; and there is no downtime.
Which Virtual Machine to Use Because we are talking about Linux here, you have several options, such as VMware, Qemu, KVM, Xen, and VirtualBox, among many others; each with their own pros and cons. Of these, I prefer VirtualBox (see Figure 1 above), even though solutions like KVM can be more powerful and efficient. The reason I chose VirtualBox is that it’s extremely easy to use even by a new Linux user. It has tons of features and functionalities that can be easily accessed without any hard-core technical knowledge. The biggest advantage is its cross-platform support - you can install VirtualBox on Linux, Windows, and Mac OS X. How to Use VirtualBox You can and install it on your system like a regular application.
For this story, I installed VirtualBox on a MacBook Pro so that I can use Linux on the same machine. Open the VirtualBox app and click on the New button to create a new virtual machine. Give the machine a name (which should be the name of the distro).
Then, enter the amount of RAM you want to allocate to the virtual machine. Now you have to create virtual hard drive for the system; I would suggest VDI format. Here you can choose dynamically allocated size, because it won’t reserve all the allocated space and will grow as it uses more space. However, it can’t exceed the space you allocated. In the next step, you can choose the amount of space you want to allocate to the virtual hard drive. At this stage, you can also choose the location of the drive on the physical hard drive.
You are almost there; you will see the name of the newly created virtual machine in the left pane. When you click on it to start the system, in the first run, it will ask for the.iso image of the distro that you want to install on the system. Just browse to the.iso image of your desired distro and there you have a Linux distro running inside the Mac OS X (Figure 2). One advantage is that, once you have a virtual machine up and running, you can just move the vdi file around and get the same distro up and running with all settings and data. This comes in handy if you are migrating from one host (host is the system where you install VirtualBox software and guest is the OS that runs inside VirtualBox) system to another.
Customizing Virtual Machines Depending on your distribution, you may or may not be able to get full screen resolution. In such cases, you will have to install some virtualbox packages inside the guest OS. The most common packages are virtualbox-guest-additions-iso, virtualbox-guest-x11, virtualbox-guest-dkms, and virtualbox-guest-utils (Figure 3). You can further tweak the VirtualBox settings to bring the guest and host OS closer. Shut down the virtual machine and click on Settings for that machine.
In the General tab, go to Advanced and select Bidirectional for Shared Clipboard and Drag and Drop. Now you can copy and paste text between guest and host machines.
You will also be easily drag and drop files between the two machines. In some cases, you may have to also change the default network from NAT to Bridged Adapter to access the local network (Figure 5). I run a local file server, so I always switch to Bridged Adapter (more about file sharing later). You can also change the amount of RAM allocated to the virtual machine, just open the System from the settings and modify RAM from the Motherboard tab; if you need to increase CPU capacity of the VM, you can easily do that from the Processor tab. What you can’t easily change is the storage space; that needs extra work, so be thoughtful with hard drive space when you create a virtual machine.
How to Share Directories Between Host and Guest In Settings, you will find an option where you can add “shared” folders from the host machine to the guest system. However, because I run a local file server that keeps all my files, I simply mount the file server on the VM and then gain access to all my files. You can also enable access to USB ports so you can use the USB devices plugged into the system. Just go to the ports tab and add any USB devices connected to the system. That’s pretty much what I do on my VirtualBox.
If you haven’t tried VirtualBox before and have been multi-booting, you should give virtual machines a try. If you are a VirtualBox user, let us know in the comments what all you use it for.
While it is not very difficult to install Linux alongside Windows or Mac OS X in a separate partition, it is often quicker and “safer” to install Linux within a virtual machine on the host operating system. A virtual machine is basically a program that runs in your host operating system and simulates the environment for a completely separate computer system, where you can install basically any guest operating system. The “host” operating system is your main operating system. If you bought a computer from Dell, your host operating system is most likely Windows. If you bought a Macintosh computer, your host operating system is Mac OS. The guest operating system is the operating system that is being installed within the virtual machine. We will be using the VirtualBox virtual machine because it’s open source and freely available.
1.) Go to the Virtual Box website and download the version of virtual box that matches your host operating system. The installation process should be as simple as installing any other program on your host operating system. Now that you have Virtual Box installed, we need to install Linux within a new virtual machine. We will be using the 64-bit version of Ubuntu 12.04. There are a number of flavors of Linux, but Ubuntu happens to be one of the most popular Linux desktop operating systems today (8/22/2012).
If you were to install Linux natively on your computer, you would download an.ISO image, burn it to a CD, then boot from that CD. However, since are using a virtual machine, all you have to do is download the.ISO image and use VirtualBox to install from the.ISO image.
2.) Download the Ubuntu install image. Go to: and select the 64-bit version for download. 3.) Install Ubuntu within VirtualBox. Within VirtualBox, click on Machine - New Give the new virtual machine a name like, “Ubuntu.” For Operating System type, select Linux and Ubuntu (64-bit) for the version. The default settings are selected based on the operating system type and version, so just click Next through the following menus unless you really want to change the settings. Many of these settings can be changed later as well. After the Virtual Machine has been created, right-click on the new machine in the VirtualBox manager and click Start.
![Mac Mac](/uploads/1/2/5/6/125612340/363898503.jpg)
When your virtual machine starts for the first time, VirtualBox will run a wizard where it will ask you to “Select Installation Media.” When asked for the installation media, use the folder icon to navigate for the Ubuntu.ISO image that you downloaded in the previous step. Click Next through the remaining options and Ubuntu 12.04 will begin installing itself in your virtual machine as if it were installing on a system from scratch.
4.) Notes when installing Ubuntu:. When asked to “Try Ubuntu” or “Install Ubuntu” click on “Install Ubuntu.”. If you have have an internet connection during installation, you should click on “Download updates while installing” and “install this third-party software.”.
Under “Installation Type,” click on”Erase disk and install Ubuntu.”If running the Ubuntu CD from within the virtual machine, this will only affect the virtual machine’s disk space, not the disk space outside of the virtual machine. Make sure this is installing within the virtual machine, otherwise, you could be overwriting your host operating system’s disk space. After installing Ubuntu within VirtualBox, check out the next tutorial on some basic. Questions / Comments: Author.