Posts Tagged virtualbox

Converting a virtual disk image: VDI to VMDK to a raw loopback file you can mount

By default, VirtualBox creates virtual disk images in a special format called VDI, which is unique to VirtualBox. Disk images are stored in $HOME/.VirtualBox/HardDisks.

You’ll need to convert VDI into another format if you want to run a VirtualBox VM on another virtualization platform, such as VMWare or KVM.

The VMDK virtual disk format is a good choice because even though it originated with VMWare it is supported by other virtualization platforms including VirtualBox and KVM.

VirtualBox enables the conversion using the low-level “VBoxManage clonehd” command:

VBoxManage list hdds # prints a list of disk image UUIDs
VBoxManage clonehd -o converted.vmdk format VMDK
cd ~/.VirtualBox/HardDisks/
ls -la converted.vmdk

Once you have converted to VMDK you can use qemu-img, a tool bundled with qemu (KVM’s virtualization backend) to further convert VMDK to other formats.

A particularly useful format to convert to is ‘raw’ which you can then mount as a loopback device:

apt-get install qemu
qemu-img convert -f vmdk converted.vmdk -O raw converted.raw
mount -o loop converted.raw /mnt

,

No Comments

Enable USB Camera in Virtualbox

Due to some IM need camera in my virtualbox. get the result from ubuntu
if [ "`grep vboxusers /etc/group|grep $USER`" == "" ] ; then sudo usermod -G vboxusers -a $USER ; fi
restart the virtualbox. and follow the following instructions
DO NOT add the line to /etc/fstab, or you may meet some issue 🙂
none /proc/bus/usb usbfs devgid=groupid,devmode=664 0 0
Details
https://help.ubuntu.com/community/VirtualBox/USB

Also: furiusisomount can mount .bin file that can be mount as cd-rom in Windows.

,

No Comments

Volume group “VolGroup00” not found

Met a problem when try to copy virtualbox vdi file directly from Windows virtualbox to Linux

“Error: Volume group “VolGroup00″ not found
……
Kernel panic – not syncing: Attempted to kill init!”

Solution:
First, boot up in rescue mode, using the CentOS cd, type “linux rescue” on the first boot prompt.

Now chroot to you actual system:
#chroot /mnt/sysimage

Then, backup your initrd:
#cd /boot
#mv initrd-2.6.18-164.el5.img initrd.backup

(use the last version, or the one you are trying to boot, on the “2.6.18-92.el5.img” part)
Now rebuild your initrd:

#mkinitrd /boot/initrd-2.6.18-164.el5.img 2.6.18-164.el5
(Same thing about the versions)

#reboot

,

No Comments

Volume group "VolGroup00" not found

Met a problem when try to copy virtualbox vdi file directly from Windows virtualbox to Linux

“Error: Volume group “VolGroup00″ not found
……
Kernel panic – not syncing: Attempted to kill init!”

Solution:
First, boot up in rescue mode, using the CentOS cd, type “linux rescue” on the first boot prompt.

Now chroot to you actual system:
#chroot /mnt/sysimage

Then, backup your initrd:
#cd /boot
#mv initrd-2.6.18-164.el5.img initrd.backup

(use the last version, or the one you are trying to boot, on the “2.6.18-92.el5.img” part)
Now rebuild your initrd:

#mkinitrd /boot/initrd-2.6.18-164.el5.img 2.6.18-164.el5
(Same thing about the versions)

#reboot

,

No Comments

Change vdi UUID with VBoxManage

We can directly copy the vdi for new VirtualBox vms.but the UUID will be the same as old one. so we need to change the UUID

$VBoxManage internalcommands setvdiuuid /opt/vms/c52_master.vdi
VirtualBox Command Line Management Interface Version 3.0.10
(C) 2005-2009 Sun Microsystems, Inc.
All rights reserved.
UUID changed to: aa742648-c3f4-408f-bde8-827dadff5cca

if in Windows, find the installation directory of Virtualbox and then run the VBoxManager.exe command in cmd lines.

,

1 Comment