Virtualbox: Difference between revisions

From 太極
Jump to navigation Jump to search
Line 23: Line 23:


== Share folders ==
== Share folders ==
Suppose we want to share the <Downloads> folder from host to guest.
Suppose we want to share some folder from host to guest. Assume in Virtualbox, we use "Downloads" as the folder name in ''Share Folders'' dialog.
 
We can use the following method to get an access to Downloads folder for this session only.
<pre>
sudo mkdir /mnt/Downloads
sudo mount -t vboxsf Downloads /media/downloads
</pre>
 
Or we can use the following method for permanent solution.
<pre>
<pre>
sudo nano /etc/fstab
sudo nano /etc/fstab
Line 32: Line 40:
</pre>
</pre>


Note that the auto-mount option is supposed to work automatically. See https://www.virtualbox.org/manual/ch04.html#sf_mount_auto. But I get a permission denied error. The reason is we have to add the current user to the group '''vboxsf'''.
Note that the [https://www.virtualbox.org/manual/ch04.html#sf_mount_auto auto-mount] option is supposed to work automatically. But I get a permission denied error. The reason is we have to add the current user to the group '''vboxsf'''.
<pre>
<pre>
sudo usermod -a -G vboxsf USERNAME
sudo usermod -a -G vboxsf USERNAME
# logout and login again
# logout and login again
</pre>
</pre>
See http://www.cyberciti.biz/faq/howto-linux-add-user-to-group/ for more examples of '''usermod''' command.
See http://www.cyberciti.biz/faq/howto-linux-add-user-to-group/ for more examples of using '''usermod''' command.


= Use VirtualBox =
= Use VirtualBox =

Revision as of 16:34, 10 April 2014

Installation on Ubuntu

http://www.ubuntugeek.com/virtualbox-4-3-8-released-and-ubuntu-installation-instructions-included.html

Virtualization in the host machine

Note that even the host machine is 64-bit, if the vT is not available/enabled in the BIOS, we cannot install 64-bit OS in the guest machine.

Virtual box guest addition

Install guest addition for virtualbox on Debian See the link [1]

virtual machine software benchmark

Trouble Shooting

virtualbox failed to create the host-only network

Virtualbox (*.deb) was downloaded from virtualbox website. However, when I want to create a host-only network, I have to execute

sudo /etc/init.d/vboxdrv setup
sudo apt-get install dkms build-essential linux-headers-$(uname -r)

This also solves the error "Kernel driver not installed (rc=-1908)".

Share folders

Suppose we want to share some folder from host to guest. Assume in Virtualbox, we use "Downloads" as the folder name in Share Folders dialog.

We can use the following method to get an access to Downloads folder for this session only.

sudo mkdir /mnt/Downloads
sudo mount -t vboxsf Downloads /media/downloads

Or we can use the following method for permanent solution.

sudo nano /etc/fstab
sudo mkdir /mnt/Downloads
# Add a new line
# Downloads /mnt/Downloads/ vboxsf defaults 0  0  
sudo mount -a

Note that the auto-mount option is supposed to work automatically. But I get a permission denied error. The reason is we have to add the current user to the group vboxsf.

sudo usermod -a -G vboxsf USERNAME
# logout and login again

See http://www.cyberciti.biz/faq/howto-linux-add-user-to-group/ for more examples of using usermod command.

Use VirtualBox

Increase the guest machine space

Different networks

Clone vs Import/Export appliance

Clone will create a new VM directory (including *.vdi) on the same machine.

Import/Export appliance (*.ova) allows to transport the appliance to a new machine. The appliance will not be touched on the new machine.

vmware

apt-get update
apt-get install build-essential module-assistant
m-a prepare
cd Downloads
tar xzvf /media/cdrom0/VMwareTools-9.2.0-799703.tar.gz
cd vmware-tools-distrib
./vmware-install.pl
[Accept all default]
shutdown -r now

Emulation vs virtualization

Virtualization allows users to configure virtual machines outfitted with similar hardware and processors as the host system, whereas emulation simulates different hardware and processor configurations in software.

Emulators are what allow you to run old Commodore 64 or NES games on a PC, for example.