Virtual machines for linux ubuntu

VirtualBox

This document provides information on using the VirtualBox system emulator in Ubuntu. VirtualBox can run a «guest» operating system in a window of the host operating system without giving it direct access to your computer’s hardware. (Instead, Virtualbox passes hardware-related instructions through the «host» operating system’s drivers.) VirtualBox can run all versions of Windows, Linux, and many other x86- and AMD/Intel-based 32- and 64-bit operating systems as either a host OS or as a guest OS. Although some versions of Linux (including Ubuntu) exist that are optimized to run as a guest OS in a virtual environment, any Linux operating system usually will function equally well.

  • providing a self-contained environment in which to experiment with new software without risking damaging changes to the host operating system
  • to run legacy operating systems and software that may no longer be supported by newer operating systems

No special hardware is required to run a virtual machine, although recent processors have virtualization «hooks» which interact specifically with virtual machines to improve performance.

Installation and configuration

Using Virtual Box

The VirtualBox can be run from the menu Applications > System Tools > A kernel module is started when the host computer is booted, but nothing happens until you manually start a virtual machine. This can be automated by a script, but by default, if you reboot your host, your guest machines will not be running any more.

For help getting started, VirtualBox/FirstVM describes setting up an Ubuntu guest using VirtualBox.

Un-Grabbing the mouse & keyboard

In the bottom right hand corner of the emulated machine window is the name of the key required to make Virtual Box un-grab the mouse and keyboard. By default this is Control_R which actually means the right hand Control key, not control and the letter R.

Networking

VirtualBox 2.0 and onwards provides straightforward networking allowing IP address assignment and internet access using NAT, the default network option. See VirtualBox/Networking for more sophisticated set-ups, and information for older versions of Ubuntu and VirtualBox.

Читайте также:  Run linux with virtualbox

USB

VirtualBox/USB describes setting up USB devices. This allows the guest vm to use USB devices plugged into your host.

Sharing Folders Between Host and Guest

VirtualBox/SharedFolders describes sharing folders on the host with guests. This is the Virtual Box method, but others are available, such as standard samba, nfs, and using internet-based storage. The VirtualBox method is optimised Samba.

Using VirtualRDP (VRDP) to View Guest VMs

It is possible to make RDP (Remote Desktop Protocol) connections to virtual machines. This is typically used when accessing a virtual machine on a different computer, because the host computer can display the console directly, and this provides a more fluid user experience. See VirtualBox/RDP for more information.

Installing Virtualbox in Windows

The reason to install Virtualbox in Windows is so that Ubuntu Linux can be run as a guest OS within the virtual machine.

Virtualbox (by Sun) has some advantages and disadvantages. There is a free proprietary edition as well as a subscription-based enterprise edition. The free edition only allows usage of a 32-bit operating system (as the guest OS) whereas the subscription edition allows a 64-bit guest OS. (Both require registration.) There is also has a free open source edition, but this is not easy to install in Windows (unlike in Linux). Virtualbox is available for all operating system platforms, and therefore a virtual machine created in one operating system (Windows, Apple, Linux) can be used in another. Furthermore, it is possible to convert virtual machines created in Virtualbox to VMWare and vice versa.

  • Obtain and download a copy of the Virtualbox (binary) installer for your (Windows) operating system here.
  • Install the program, following the prompts.
  • Start Virtualbox

Start menu -> Programs -> Sun Virtualbox -> Virtualbox

-> Next -> Memory: Base memory size: 1024 Mb

Note: Use the amount of RAM for the virtual machine that you can afford. Linux requires less memory to run than does Windows, but the amount of RAM that you dedicate to the virtual machine in this step will not be available to the Windows host. On my laptop, I have 3 Gb RAM, so I dedicate 1024 Mb (1 Gb) to the virtual machine in this step and leave 2 Gb for Windows. You should always leave at least 1 Gb RAM for Windows (or it will run painfully slowly). Linux is able to run with only 512 Mb in server mode or 1 Gb in desktop mode (perhaps even less).

Читайте также:  Linux module undefined symbol

Boot Hard Disk (Primary Master): (ticked)

Create new hard disk: (ticked)

-> Next -> Next -> Hard disk storage type:Dynamically expanding storage: (ticked)

-> Next -> Virtual Disk Location and Size:

Note: Use whatever size you can afford in Windows. This will take space from your hard drive (so make sure it is available to begin with). A Linux server can easily run in 8 GB, but if you plan to run a GUI desktop in addition (the Ubuntu desktop or Kubuntu desktop, for example), you should consider making this between 10 -20 GB. However, because you have chosen the dynamically expanding storage in the preceding step, the virtual machine will automatically expand storage later if you guess wrong here. (I usually just accept 8 GB.)

Now you will have a new virtual machine. You can create multiple virtual machines, in this fashion. If you desire, you can run each new virtual machine simultaneously (if you have enough RAM and hard drive resources).

Install Ubuntu Server as Guest OS

Other resources

Common issues

Ubuntu 12.04 LTS

Module issues

If you update virtualbox. The modules and the module API may change. Which means you have to compile the modules for your kernel.

  • WARNING: The character device /dev/vboxdrv does not exist.
    • Please install the virtualbox-ose-dkms package and the appropriate headers, most likely linux-headers-generic. You will not be able to start VMs until this problem is fixed.
    • Error! Your kernel headers for kernel 3.2.0-26-generic cannot be found. Please install the linux-headers-3.2.0-26-generic package, or use the —kernelsourcedir option to tell DKMS where it’s located

    Moving VirtualBox Hard Drives

    • created a virtualBox machine, it placed the hard drive at its default position along side the .vbox file and Logs folder and you wanted the actual hard drive on another physical hard drive or partition;
    • decided to move the VirtualBox hard drive to another drive or partition or location, yet keep the location of the VirtualBox machine in the same place.

    You need to edit the .vbox file, in this example Windows.vbox, as there doesn’t appear to be any mechanism in the GUI to change the drive location. Using vboxmanage is very cryptic and challenging for the average user to grasp. Make sure VirtualBox is not running when you make these edits and save a copy of the original file first.

    1. section,
    2. sub section,
    3. sub-sub section,
    4. sub-sub-sub section
    5. location=»».
     " name="Windows" OSType="WindowsXP" snapshotFolder="Snapshots" lastStateChange="2014-05-14T22:52:48Z">  " location="Windows.vdi" format="VDI" type="Normal"/> " location="/usr/share/virtualbox/VBoxGuestAdditions.iso"/> 

    In this example you could change location="Windows.vdi" to location="/media/bigdrive/vbox/Windows.vdi" assuming that is the new location of your VirtualBox Hard Drive.

    Alternatives to Virtualbox

    • Xen is the Ubuntu-supported virtualization platform used for cloud computing. it is the basis for the Amazon EC2 cloud.
    • Another Ubuntu-supported virtualization system is called KVM. It is officially supported, but is somewhat harder to set up for the average user. It also requires hardware virtualisation extensions in your CPU.
    • VMware is a proprietary alternative, with a free virtual machine player available. A free server for Linux can also be found.
    • QEMU is the original virtualization system, on which Virtualbox and KVM are based. It is completely open source and can be used with or without the virtualization hooks found in many new processors.

    It is possible to convert virtual machines between these systems (but it is sometimes a time consuming process). A new «open virtualization format» has been created that can be used in several alternative virtual machines ‘Open_Virtualization_Format’ (Wikipedia) — Wikipedia page on ‘Open_Virtualization_Format’.

    VirtualBox (последним исправлял пользователь 24 2014-05-21 16:56:58)

    The material on this wiki is available under a free license, see Copyright / License for details
    You can contribute to this wiki, see Wiki Guide for details

    Источник

Оцените статью
Adblock
detector