Sun Virtual Box

Aus Wiki
Zur Navigation springen Zur Suche springen


  1. Install using Synaptic Package Manager (including dkms etc.; packages virtualbox-ose & virtualbox-ose-guest-utils(don't know if necessary) (Alternatively installable via [1] since open source edition (OSE) does not support USB.)
  2. Download guestadditions manually from File VBoxGuestAdditions_2.0.4.iso. Move&rename this file to /usr/share/virtualbox (sudo mv /user/pfu/download/VBoxGuestAdditions_2.0.4.iso /usr/share/virtualbox/VBoxGuestAdditions.iso). Then select 'Add guest additions' in VirtualBox menu
  3. Program can be started from 'Applications', 'Accessories', 'Virtual Box OSE'
  4. If you have a Windows guest OS you can access the exchange directory via net use t: \\vboxsvr\vbox-exchange (if vbox-exchange is valid directory in your home directory)
  5. Add fonts from CorelDraw7 CD1 (see [2], e.g. Zurich fonts used for headers in different FW-document templates):
    1. Start, Run: %windir%\fonts
    2. File, Install New Fonts

Create MBR-file for starting the existing partition

Save MBR of the NTFS-partition: sudo dd if=/dev/sda2 of=sda2.mbr bs=512 count=1

Not working alternative:

  1. Download MBRwizard: and unpack it (no installation needed)
  2. Show current settings of saved MBR: sudo ./mbrwiz /ShowFile=backup-sda.mbr

Access existing partitions (boot from existing partition)

  1. create /home/pfu/.VirtualBox/Machines directory, if it not yet exist
  2. Execute in shell: sudo VBoxManage internalcommands createrawvmdk -filename /home/pfu/.VirtualBox/Machines/XpHomeNtfs.vmdk -rawdisk /dev/sda -partitions 2,6 -relative -mbr /home/pfu/.VirtualBox/Machines/sda2.mbr -register

sudo VBoxManage internalcommands createrawvmdk -filename /home/pfu/.VirtualBox/Machines/XpHomeNtfs.vmdk -rawdisk /dev/sda -partitions 2,6 -register Now, the file XpHomeNtfs.vmdk should exist under Machines.

/dev/sda2 is ntfs partition, /dev/sda6 is ntfs_data partition in my case
-register Registers set vdmk-file in GUI.
Overview of existing partitions sudo VBoxManage internalcommands listpartitions -rawdisk /dev/sda (or start Ubuntus Partition Editor)
  1. Unmount partitions which shall be used by VirtualBox:
sudo umount /media/ntfs
sudo umount /media/ntfs_data
  1. Start GUI as admin to get read/write access to harddisk: gksu VirtualBox
  2. Create new machine (XP_on_NTFS) and add XpHomeNtfs.vmdk as machine.


  • VirtualBox currently does not support LPT1 (they are working on it on a low priority)
  • Variant 1: For accessing a network driver you have to enter an URL like this: ( is C530 is the printer name)(see Forum entry) Did not longer work recently...
  • Variant 2 (best one): 'Add Printer', 'Local printer', Add Port: (printer's IP address), Windows recognizes printer type automatically, go on as normal...
  • Variant 3 (only works if NAS is on / had problems (among others) when printer started after the NAS): Accessing a printer connected to my NAS do the following:
  1. Add printer, connect to printer on the Internet or on your intranet: http://N3200.:631/printers/usb-printer
  2. Install the appropriate driver...

Some remarks

  • Start VirtualBox as admin: gksu VirtualBox
  • Do dualbooting Windows with VMware: [3]

Increase size of image file

See here

  • Go to your vdi file, open console and enlarge with (e.g. for 20 GB): VBoxManage modifyhd Ubuntu64Bit.vdi --resize 20000
  • Download gparted and add it as CD drive in your VM.
  • Check that boot order of VM checks the CD drive.
  • Start VM which now should start gparted: In my case I had to run into shell (Failsafe mode, 'enter command line prompt'), then start X ('startx'), right-mouse-click to start gparted
  • Then I increased the extended partition, moved the swap-partition and applied it. After that I minimized the extended partition and was then able to increase the primary partition.
  • Remove the gparted-iso file and restart into your VM.

See [4].

  • Download GParted LiveCD e.g. from here: (select iso-image, e.g. gparted-live-0.5.2-9.iso)
  • Add enlarged VDI (the VDI which shall be used afterwards)
  • Add GParted-iso file as CD-image to existing VDI
    • Gparted-iso: primary master
    • the two harddisks as primary slave and secondary master
  • Boot VDI which now should boot GParted. In GParted:
    • Create new partition table on new harddisk
    • Copy existing partition, enlarge image
    • 'Apply' (takes quite a long time)
    • Set 'boot'-flag on new partition: 'Partition', 'Manage Flags', select 'boot'
    • quit GParted, double-click on exit icon to exit
  • Remove old VDI and Gparted iso file, set new VDI as primary master
  • Startup the enlarged VDI (normally Windows notices the difference and executes checkdisk)


Improving performance could be done by disabling VT-x / AMD-V (Settings, System, Acceleration). See performance tips

USB access

See Remark from Frank Dec 3 2009.

  1. sudo gedit /etc/fstab
  2. none /proc/bus/usb usbfs devgid=1000,devmode=664 0 0
You can find out your gid by: id <username>
  1. Restart computer

Does it work or not?

Update to 4.0

  1. Add repository in Synaptic Package Manager:
    1. Click 'Settings', 'Repositories', 'Other Software'
    2. 'Add...', enter 'deb lucid contrib' (Instead of 'lucid' you could run lsb_release -sc')
    3. Press 'Reload'
    4. If error message appear, reload PGP keys with: sudo apt-key adv --keyserver --recv-keys <key as seen in error message> (
    5. Press 'Reload' again to check if everything is fine now. (virtualbox 4.0 should now appear)
  2. (In Synaptic Package Manager) Remove old VirtualBox
  3. Install VirtualBox 4.0
  4. Download Extension Pack. Open VirtualBox, 'File', 'Preferences', 'Extensions', add extension and select the downloaded file. Install the extension. (Enter your root-password when asked for a password (dialogue is a bit misleading).)
  5. Add yourself to 'vboxusers' group, otherwise you won't be able to pass USB-devices to client VMs: sudo usermod -a -G vboxusers pfu. (See [5].) To take in effect, you have to relogin!!!


Add Windows 7 VM

  1. Create new VM, place CD-ROM with Windows-7 in drive and add it to VM
  2. Make sure that I/O-caches of all controllers are set
  3. do the whole Windows-7 installation
  4. Install guest-additions:
    1. remove Windows-7 installation-CD, but don't remove whole CD-drive ("Leave empty")
    2. start Windows-7 VM and click 'Devices', 'Install Guest Additions...' in the menubar. This takes a moment. Then 'Run VBoxWindowsAdditions.exe'. Y, Y, Next, Install, Install, Install, Reboot now.