User Tools

Site Tools


virtualbox

VirtualBox - the virtual machine

Detailed Installation and configuration process of the virtualization program VirtualBox

Note that this page uses the example of a machine type “686-pae”. If you use a handylinux-486 distribution, consider adapting commands.

Basics

VirtualBox allows you to run a distribution in another distribution seamlessly. You can test a distribution or use a system to work (eg. windows virtual to manage some devices).
You can access to your USB ports, network and even share files between the host machine (the real machine) and the guest machine (virtual machine).
If your machine is powerful enough, the transition from one system to another is fluid and transparent way, allowing you to enjoy a system of “two-in-one”.

VirtualBox Installation

With HandyLinux, we'll go through the terminal to quickly install Virtualbox and its dependencies.
Direction HandyMenu, “Raiders” section, “Open Terminal” button. In the terminal window, type the following command to install the necessary kernel modules linux, virtualbox and its interface - replace 686-pae by 486 if you use HandyLinux-486 :

sudo apt-get install linux-headers-686-pae virtualbox virtualbox-dkms virtualbox-qt virtualbox-source


Using VirtualBox

Launch VirtualBox

To launch VirtualBox, direction HandyMenu, “Raiders” section, “Applications List”. In “System”, select “Virtualbox”.

Faster? yes … simultaneously press the [Alt] and [F2] on your keyboard. Window that appears allows you to run a program directly. Type “virtualbox” then press “Run”:

Add the Extension Pack

Support for USB 2.0 devices, VirtualBox RDP and PXE boot for Intel cards. Go to https://www.virtualbox.org/wiki/Download_Old_Builds_4_1 and download the pack that fits your version (available in Help / About) click on the extension pack and select Open with Virtualbox.

Create a virtual machine

The main VirtualBox interface is very simple: to create a new virtual machine, click on “New”.
The configuration wizard will appear and assist you in the creation and basic configuration of your new virtual machine. Here are the successive steps:

  • startup wizard virtual machine
  • configure the name and type of operating system
  • configure the memory allocated to the virtual machine
  • configuration of the virtual hard disk
  • configuration of the virtual disk type
  • storage type (fixed or dynamic)
  • size and location of the virtual disk
  • summary
  • confirmation of the parameters of the new virtual machine

Configure a virtual machine

You must specify the path to your ISO image to test and configure the type of processor used. Other settings are available, but these settings are enough for“test distribution method” use.

  • In the main VirtualBox window, select the distribution to configure, and click on “Configuration”:
  • Select the tab “Stockage” to define the disk image to use:
  • In “Stockage”, select the drive (identified by a CD):
  • In the drop-down menu right of the window, select “Choose virtual CD/DVD…”:
  • In the window that appears, navigate through your data to the ISO image to test:
  • Back to settings, your ISO image should appear in the reader line:
  • If you want to test a “686-pae” distribution type, make sure you enable PAE/NX option in the “System” tab : “Processor” settings of your virtual machine:

Launch a virtual machine

Once you have configured virtual machine, click on “Start” in the main VirtualBox window:

The principle of the virtual machine is simple: what you see in the new window is a different computer. A series of informational messages about the capture keyboard and pointer are displayed at launch, then your virtual machine starts:
You can now test the use of live and installation process of your ISO Image.

Good virtualization !

Backup a virtual machine

You can save the state of your virtual machine until the next launch, restart your virtual machine with your office, etc. .. open applications such as when you left.
To save a virtual machine, select “Close” and “Save the machine state”:

Go further

File sharing, USB connection, and detailed Virtualbox configuration options.
Keep in mind that a virtual machine works best when installed. Some functions are not available when the virtual machine starts on a live CD.

USB port

VirtualBox allows you to take into account your USB ports (those of the real machine) in your virtual machine. Note that a USB device is visible to the virtual machine when mounted on the host machine.To use this option, you must first be a member of the group “vboxusers”: open a terminal (HandyMenu > Raiders > Open Terminal) and type the following command:

sudo adduser $USER vboxusers

You must log out to enable changes.
Then, configure VirtualBox :

  • first, connect your USB device,
  • launch VirtualBox and select the virtual machine to activate,
  • open the virtual machine configuration menu,
  • in the “USB” tab, add your device:
  • your USB key will be recognized in the virtual system.

Shared folder

Folder sharing involves an installed virtual machine (not starting on a live CD).
It allows you to pass data between the host machine (the real machine) and the guest machine (virtual machine).

Guest additions installation

To share files between the host and guest machine, we begin by installing the “guest-additions” that improve virtualization in the host machine:

sudo apt-get install virtualbox-guest-additions-iso

Once done, you can run VirtualBox and open your virtual machine. Guest Additions are mounted in the virtual machine: Devices menu > Install Guest Additions… :
The ISO image is mounted in the guest system.

  • To install the guest additions from a GNU/Linux box: here with Emmabuntus virtualized.
    Note that installing additions means installing linux “headers”. If the virtualized distro doesn't includes headers (ex HandyLinux), you have to install it with this command (adapt '686-pae' to your configuration)
    sudo apt-get update && sudo apt-get install linux-headers-686-pae dkms

    After selecting “Install Guest Additions”, the image is mounted as a CDROM. On Emmabuntus media opens automatically, on other GNU/Linux distributions you may need to navigate to /media/VBOXADDITIONS_xxxxx.

    Once in the folder, double-click “autorun.sh” to run the installation script or from a terminal “cd /media/VBOX[TAB]([TAB] helps to complete names)” then enter the command “./autorun.sh” or “sudo sh ./VBoxLinuxAdditions.run” depending on the virtualized OS. Your password will be requested:

  • To install the additions from a Windows guest post: here with windows XP virtualized.
    After selecting “Install Guest Additions”, the installation program Guest Additions window appears on your windows desktop. Just follow the instructions and over pass warnings (Virtualbox has no Microsoft™ sticker):

In both cases, you must restart your guest system for the changes to take effect.

Enable shared folder

To share data between the guest and host system, I suggest you to set up a specific folder, in order to avoid unwanted errors/erase.
For example, I chose to create a folder /home/$USER/VBoxshare in my personal files. It is this folder I will indicate in the VirtualBox through the configuration screen of the virtual machine (click to launch the distribution, then “Settings” in the VirtualBox menu bar) interface:

Consult shared folder

Once launched your virtual machine, you can access the contents of the shared folder:

  • from GNU/Linux guest machine: here with virtualized HandyLinux
    On GNU/Linux, you must create the shared folder and mount it. It also requires that the user is member of the group vboxsf. All in 3 commands:
    sudo adduser $USER vboxsf
    sudo mkdir /media/VBoxshare
    sudo mount -t vboxsf VBoxshare /media/VBoxshare


  • from windows guest machine : here with windowsXP virtualized
    The shared folder will be available in your file browser, menu > Tools > “Connect to a network drive”. Choose the letter you want to define the folder (eg Z:) and you shared folder (dans notre cas \\vboxsvr\VBoxshare ) :
virtualbox.txt · Last modified: 2017/01/14 03:01 (external edit)