Differences between version 2 and previous revision of VirtualBoxNotes.

Other diffs: Previous Major Revision, Previous Author

Newer page: version 2 Last edited on Thursday, 24 January 2013 0:34:56 by CyberLeo Revert
Older page: version 1 Last edited on Tuesday, 30 June 2009 11:12:18 by CyberLeo Revert
@@ -10,4 +10,46 @@
 VBoxManage convertfromraw image.bin image.vdi --format=VDI 
 </verbatim> 
  
 The resultant file will be a growable image, though it was significantly larger on mine than either the raw bin (allocated) or the vmdk. 
+  
+!! Attach a raw (dd-style) disk image to a VM  
+First, attach it to a loopback device  
+<code brush="bash">  
+# Linux  
+losetup -f disk.img  
+# FreeBSD  
+mdconfig -a -t vnode -f disk.img  
+</code>  
+  
+Create a vmdk pointing to it  
+<code brush="bash">  
+VBoxManage internalcommands createrawvmdk disk.vmdk -rawdisk /dev/loop0 # Or /dev/md0, wherever the image was attached  
+</code>  
+  
+Remove the loopback  
+<code brush="bash">  
+# Linux  
+losetup -d /dev/loop0  
+# FreeBSD  
+mdconfig -d -u 0  
+</code>  
+  
+Edit the vmdk thus created, and change the path to point to the file  
+<code brush="diff">  
+ # Extent description  
+-RW 2097152 FLAT "/dev/loop0" 0  
++RW 2097152 FLAT "disk.img" 0  
+</code>  
+  
+Make sure the two files are always in the same directory.  
+  
+Attach to VM and test.  
+  
+!! Configure VNC ext pack (4.2.6 OSE or later)  
+<code brush="bash">  
+# Enable VNC extpack  
+VBoxManage setproperty vrdeextpack VNC  
+  
+# Turn on VNC for a VM  
+VBoxManage modifyvm <name> --vrde on --vrdeport 5900 --vrdeproperty VNCPassword=password  
+</code>  

version 2

Convert from VMware VMDK to VirtualBox VDI

qemu-img convert image.vmdk image.bin

The resultant file will be a full-sized image, but sparse.

VBoxManage convertfromraw image.bin image.vdi --format=VDI

The resultant file will be a growable image, though it was significantly larger on mine than either the raw bin (allocated) or the vmdk.

Attach a raw (dd-style) disk image to a VM

First, attach it to a loopback device

# Linux
losetup -f disk.img
# FreeBSD
mdconfig -a -t vnode -f disk.img

Create a vmdk pointing to it

VBoxManage internalcommands createrawvmdk disk.vmdk -rawdisk /dev/loop0 # Or /dev/md0, wherever the image was attached

Remove the loopback

# Linux
losetup -d /dev/loop0
# FreeBSD
mdconfig -d -u 0

Edit the vmdk thus created, and change the path to point to the file

 # Extent description
-RW 2097152 FLAT "/dev/loop0" 0
+RW 2097152 FLAT "disk.img" 0

Make sure the two files are always in the same directory.

Attach to VM and test.

Configure VNC ext pack (4.2.6 OSE or later)

# Enable VNC extpack
VBoxManage setproperty vrdeextpack VNC

# Turn on VNC for a VM
VBoxManage modifyvm <name> --vrde on --vrdeport 5900 --vrdeproperty VNCPassword=password