VirtualBox - Virtualització

De WikiMar
Dreceres ràpides: navegació, cerca

Install VirtualBox in Ubuntu 14.10 - date 141104

Add one of the following lines according to your distribution to your /etc/apt/sources.list:

deb http://download.virtualbox.org/virtualbox/debian trusty contrib
deb http://download.virtualbox.org/virtualbox/debian saucy contrib
deb http://download.virtualbox.org/virtualbox/debian raring contrib
deb http://download.virtualbox.org/virtualbox/debian quantal contrib
deb http://download.virtualbox.org/virtualbox/debian precise contrib
deb http://download.virtualbox.org/virtualbox/debian lucid contrib non-free
deb http://download.virtualbox.org/virtualbox/debian wheezy contrib
deb http://download.virtualbox.org/virtualbox/debian squeeze contrib non-free


wget -q https://www.virtualbox.org/download/oracle_vbox.asc -O- | sudo apt-key add -
sudo apt-get update
sudo apt-get install virtualbox-4.3

More info: https://www.virtualbox.org/wiki/Linux_Downloads

Install Oracle VM VirtualBox Extension Pack (file .vbox-extpack) from https://www.virtualbox.org/wiki/Downloads



Compact virtual disk

In the Windows guest run:

sdelete –z

(download from http://technet.microsoft.com/en-us/sysinternals/bb897443)

Linux guest:

sudo dd if=/dev/zero of=/bigemptyfile bs=4096k
sudo rm -rf /bigemptyfile


Linux host run:

VBoxManage.exe modifyhd thedisk.vdi --compact

More info: http://superuser.com/questions/529149/how-to-compact-virtualboxs-vdi-file-size http://superuser.com/questions/529149/how-to-compact-virtualboxs-vdi-file-size

Make USB to work

Install VirtualBox

sudo adduser $USER vboxusers
sudo kate /etc/init.d/mountdevsubfs.sh

Where it says

#Magic to make /proc/bus/usb work

remove comments:

mkdir -p /dev/bus/usb/.usbfs
domount usbfs usbdevfs /proc/bus/usb -onoexec,nosuid,nodev,devgid=120,devmode=664
                                                                  120 is from grep vbox /etc/group
                                                                              vboxusers:x:120:user
ln -s .usbfs/devices /dev/bus/usb/devices
mount /rbind /dev/bus/usb /proc/bus/usb
sudo kate /etc/fstab

Add:

none /proc/bus/usb usbfs devgid=120,devmode=664 0 0


Share Folders

  • First share the folder in properties of the Virtual Machine

or do:

VBoxManage sharedfolder add "VmName" -name tmp -hostpath /tmp/
  • Add network unit in the M.V.:
    • Windows:
net use x:\\vboxsvr\tmp /persistent:yes
    • Linux:
mkdir /mount/tmp && mount -t vboxsf tmp /mount/tmp
      • or editing /etc/fstab
tmp /mount/tmp vboxsf default 0 0

To change the Floppy disk label in Windows

regedit
HKLM\SYSTEM\MountedDevices

change:

\DosDevices\A:


More info

http://lpi.aluzina.org/wiki/Plantilla:VirtualBox