Difference between revisions of "VirtualBox"

From Free Knowledge Base- The DUCK Project: information for everyone
Jump to: navigation, search
(share drive with host)
Line 78: Line 78:
  
 
By ticking Make Permanent the shared folders will also be available on the next boot and will be mounted when Auto-mount is ticked in addition.
 
By ticking Make Permanent the shared folders will also be available on the next boot and will be mounted when Auto-mount is ticked in addition.
 +
 +
=== network options ===
 +
 +
Network "Attached to" options:
 +
* Not attached - simulates NIC w/o attached cable
 +
* NAT - default to access external network, separating by a simulated router
 +
* NAT Network -
 +
* Bridged Adapter - circumvent host network stack, direct to network
 +
* Internal Network - simulated tiny LAN not visible to host or real network
 +
* Host-only Adapter - similar to Internal Network w/o use of host NIC
 +
* Generic Driver - UDP tunnel or VDE
 +
  
 
== support ==
 
== support ==

Revision as of 11:07, 3 July 2015

VirtualBox is virtualization host software that runs as an application on an established operating system. With VirtualBox you can install it on your existing Operating System and create and manage guest virtual machines, each with a guest operating system and its own virtual environment.

VirtualBox runs on Windows, Linux, Macintosh, and Solaris hosts and supports a large number of guest operating systems including but not limited to Windows (NT 4.0, 2000, XP, Server 2003, Vista, Windows 7, Windows 8), DOS/Windows 3.x, Linux (2.4, 2.6 and 3.x), Solaris and OpenSolaris, OS/2, and OpenBSD.

The core of VirtualBox is free software released under GNU General Public License version 2 (GPLv2).

Features

This is not a comprehensive list since virtualbox is truly very large in scope and capability.

  • Open Source.
  • Free Software.
  • 64-bit Guests.
  • Full Virtualization.
  • Linux, Windows, Mac, DOS, Novell, Solaris Guests.
  • Cross-Platform Host Support.
  • Guest SMP Support up to 32 vCPUs.
  • USB Support.
  • Full ACPI Support.
  • Dynamic Screen Resolutions.
  • iSCSI Storage Support.
  • PXE Network Booting.
  • Snapshot Support.
  • Remote Machine Display.
  • Extensible RDP Authentication.
  • USB over RDP.
  • Guest and Host Shared Folders.
  • Guest Additions ( Think VMware Tools).
  • Command Line Capability.
  • OVF Support.
  • VM Import/Export.
  • Thick and Thin Provisioning.
  • Wizard-driven VM Creation.
  • Easy to Install and Operate.

Interface Example:

Virtualbox-interface-ex95.jpg

basic usage

hotkeys

First you need to know what key is defined as the HOST key. Typically the default HOST key is the RIGHT CONTROL KEY. The bottom right of the Virtualbox Running VM window will indicate the currently defined HOST key.

  • Switch to Fullscreen Mode -> HOST_KEY + F

share drive with host

To share a directory with the host for the purpose of moving files from one to the other you need to install a "Guest Editions" driver on the guest machine. This enabled a way to have a shared directory that is visible to the guest machine from the host machine. Guest Editions includes other features relating to sharing between host and guest.

To install Guest Editions: In this example the host computer is Ubuntu Linux and the guest computer is Windows 7.

Virtualbox-guestadd01.jpg

Choose "Insert Guest Additions CD Image" allows the Windows guest to think that a driver CD was just inserted into an attached cdrom drive containing the necessary driver.

Virtualbox-guestadd02.jpg

On the guest machine in Windows you can see that there appears to be a driver cd available.

Virtualbox-guestadd03.jpg

Open to browse the cd by right-click and select Open. Now locate VBoxWindowsAdditions.exe and right-click to Run as administrator. You must choose "Run as administrator" on the Windows 7 guest for the driver installer to proceed.

Virtualbox-guestadd04.jpg

Complete the driver installation process which will, at the end, require you to reboot the guest Windows 7 VM.

Once installed and your guest OS rebooted, you need to create a virtual shared folder. You can do this by going to Devices again and clicking on Shared Folders.

Now click on the Add New Shared Folder button on the right.

In the Folder Path box, click the down arrow and then click Other. Browse to the folder on the host OS that you would like to share with the guest OS. In the Folder Name box, give your share a name.

"auto-mount" versus "Make Permanent" -

By ticking Auto-mount the folder will always be mounted in the Ubuntu guest directory /media/sf_myshares (the prefix sf_ will automatically be added).

By ticking Make Permanent the shared folders will also be available on the next boot and will be mounted when Auto-mount is ticked in addition.

network options

Network "Attached to" options:

  • Not attached - simulates NIC w/o attached cable
  • NAT - default to access external network, separating by a simulated router
  • NAT Network -
  • Bridged Adapter - circumvent host network stack, direct to network
  • Internal Network - simulated tiny LAN not visible to host or real network
  • Host-only Adapter - similar to Internal Network w/o use of host NIC
  • Generic Driver - UDP tunnel or VDE


support

Online User Manual

The link is: Oracle VM VirtualBox User Manual

Increase size of virtual disk

Applies to a virtual drive VDI file. Use the command 'VBoxManage' as this must be done from the console (MS-DOS prompt). For Windows XP the VBoxManage is not in the path by default, and the default base directory is Program Files. The space causes an error. To avoid, the following example is provided for Windows XP users:

C:\Progra~1\Oracle\VirtualBox\VBoxManage modifyhd "Win XP SP3 Image.vdi" --resize 45888

note: You will need to navigate to the path that contains your vdi file prior to execution of the command above! In Windows XP these are typically in a subdirectory of the following:

C:\Documents and Settings\<username>\VirtualBox VMs

Here the VBoxManage command is used to resize a 10GB image to 45GB. The quotes around the image name prevent an error due to the spaces. The use of the 8 char substitute Progra~1 prevents an error.

If you were viewing the virtual drive in Virtual Media Manager GUI, you will have to exit out and close Oracle VM VirtualBox Manager. When you open it again you will see the new size.

For Windows XP if you now start the virtual machine and goto Administrative Tools, Computer Management, Disk Management you will notice unpartitioned space. You can create a new drive letter second partition on the space. If you prefer to increase the primary partition for Windows XP you will need a 3rd party tool such as GParted via Gnome Partition Editor (download the ISO, mount it and boot from it when starting the partition. First load the VM/Win XP, on the VM menu choose Devices, CD/DVD devices, and mount the ISO of Gnome Partition Editor. Shutdown the VM. VM Settings, System, Boot Order, CD/DVD and boot Gnome Partition Editor.) Link: GParted Live CD

Howto Register and Load a vdi Image

Create a new virtual machine: in “VM Name and OS Type”, choose one of “Linux”, “BSD” or whatever matches your OS. Choose the profile that best fits your image in “Version” (for example, if you downloaded an Ubuntu virtual disk image, choose the “Linux” and “Ubuntu” pair). If you have a disk image of a Linux distribution not shown in the drop down list, choose “Linux 2.6″ or “Linux 2.6 (64 bit)” Try to find and use the best possible match for the host operating system within the image file. For memory size you can use the default or add more depending on your needs. Probably use no less than 512MB. On the Hard drive screen it is important that you select USE EXISTING HARD DISK and click the folder image to browse and select your vdi image file.

Example A: For Android image AndroidLive01

  1. Name and Operating System: type Linux, version Linux 2.6
  2. Memory Size: 512MB
  3. Hard drive: Under virtual hard disk, select Use existing hard disk option and browse for AndroidLive01.vdi
  4. Click CREATE

Make VM available from different user accounts on one computer

First you have to locate the virtual hard drive of the shared machine in a directory where different users have appropriate permissions. By default VirtualBox puts the VMs in your home directory in a path like:

/home/username/VirtualBox VMs

This can be moved to a location where all users have permission to access the VMs.

Make the VirtualBox VMs directory under /home so all users can access it.

mkdir /home/VirtualBox\ VMs
groupadd vboxusers
usermod -aG vboxusers nicolep 

We created a group vboxusers and added a user nicolep to the group.

For all VMs we can chgrp vboxusers * and chmod 775 *

To change default folder on GUI client: File -> Preferences -> General and with command line:

VBoxManage setproperty machinefolder /home/VirtualBox\ VMs

For existing VMs the second user will not be able to see those created under the first user's x.org login session because VirtualBox has a configuration file that lists the VMs. If user 1 is Joe and user 2 is Nicole, we want to make it so Nicole can use Joe's VMs.

cp /home/joe/.config/VirtualBox/VirtualBox.xml /home/nicole/.config/VirtualBox/VirtualBox.xml

Now they both have the same list of VMs.

Next problem is permissions. Every time Joe opens a VM under his login, the permissions get changed locking Nicole out. VirtualBox takes ownership of the VM and changes the permissions resulting in the following error afterwards when you switch user accounts.

Virtualbox-warning-permissions.jpg

The commands have to be manually entered again.

cd /home/VirtualBox\ VMs
chgrp vboxusers * -R
chmod 775 * -R

Having to change the permissions back each time you login as the other user is not desirable. There are some workarounds suggested by sources online.

See other comments in the discussion tab.

GUESTADDONS DOES NOT WORK IN CONSOLE ONLY, REQUIRES X.ORG

actually: it is said that you can do it in console only.

all of this is moot......................... On the GUEST when it is CentOS:

rpm --import http://apt.sw.be/RPM-GPG-KEY.dag.txt wget http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.i686.rpm rpm -K rpmforge-release-0.5.3-1.el6.rf.*.rpm rpm -i rpmforge-release-0.5.3-1.el6.rf.*.rpm yum install dkms

Now go to the menu: Devices -> CD/DVD Devices -> Choose a virtual CD/DVD disk file... select: VBoxGuestAdditions_2_2.0.iso

mkdir /mnt/cdrom mount /dev/scd0 /mnt/cdrom

yum install dkms binutils gcc make patch libgomp glibc-headers glibc-devel kernel-headers kernel-devel

ref: https://forums.virtualbox.org/viewtopic.php?f=7&t=67631

Online Resources

Download Free VirtualBox Images

Many VirtualBox images, complete with installed operating systems, are available for download from the website

These are images containing free, open source, or free to share operating systems and software only.