
- #Making a bootable mac usb with virtualbox how to
- #Making a bootable mac usb with virtualbox full size
The reason I create a large sparse image is that I want the internal partition table and inode pointers/numbers to reflect the size of the final output device ie the USB. Thus the output image will have all the FAT and file system details written in the appropriate places togehter with all the blocks that contain data.Īll internal pointers will therefore point to where they should and all blank blocks will either contain rubbish or be skipped completely depending on there location. This makes the writing quicker, as fewer blocks are written, but it doesn't reduce the size of that particulare file within the output file/image. Unused blocks within a file are passed over during the write process using a seek command. My 'general' understanding is that it's only the unused end of the file which is effectively being truncated during the write. The truth is I don't 'KNOW' the internal detials of a sparse file. All we're doing with dd_rescue is a sparse write to a raw device. In other words it carries out a sparse read and write to the file system. The standard cp command is sparse aware and will copy a sparse file in sparse format by default. However people copy, tar and untar sparse files all the time without issue. Your comment about it being dangerous seems to go back to your belief that a sparse write is somehow exortic and 'can't be done'. I don't understand your reference to 'rescue CD'? Hence my post and the description of the whole process above. This method worked in the passed but now we need an image file greater than 7.3GB and we're having trouble either creating it or mounting it. But the write of the usb is being done over and over. The converttoraw is not a big problem as we only do that once for each batch.

In using raw VMDK's We're avoiding the need for a converttoraw and utilizing the economy of a sparse write. Of course we could do a similar thing using VDI's but the reason we're currently using VMDK's brings me back to the usb writes. Losetup /dev/loop1 /vmimages/Raw-images/NEXT-IMAGE-FILE.raw We can also access any previous/branch image files from within virtual box using the same machine definition by simply repointing the loop device: In relation to these 'prepared' images we don't even have to mount them before writing them out.Īnd this writes out only the sparse image and avoids the need for a converttoraw.ĪFAIK the write process couldn't be simplier or more efficient.Īlthough I'll be happy to here of a more efficient process. I guess that's what you mean by 'prepared disk'?

Obvously we keep images for 'snapshot' and backup purposes, which can be mounted and cloned at will. Then, at a given point, we simply write the image out to usb, for the next round of testing. We can carry on developing the application and making environment changes as requests come in. That's why it's so great to work in virtual box as the development platform. We are developing/customizing an application.Ĭonsequenty we periodically create a built environment and send it out for testing.Īs bug reports and change requests are actioned we cut new build images and send them out. I'm using virtual box 4.1.16 on Linux and creating linux client vm's.

Or get the converttoraw to output a sparse file? Or use the partitions parameter and write out the raw image in a bootable form to USB?
#Making a bootable mac usb with virtualbox how to
This works but it is VERY SLOW installing direct to USB.ĭoes any one know how to get raw disks larger than 7.3G without using the 'partitions' parameter? Solutin 3) Use a vmdk to link the usb device '/dev/sdc' directly to the VM as storage. This takes time and greatly slows down the write to the usb.
#Making a bootable mac usb with virtualbox full size
Solution 2) If I use VDI's and convert them to raw it works but the convertoraw process writes them out full size not as sparse files. Solution 1) If I use the 'partitions' parameter V'box will see the large 'disk' but I can't boot the usb after writing it out. No matter how large I make the raw image file Virtual Box only sees the raw disk as 7.3GB and this is not large enough. The above method works but it has a problem. VBoxManage internalcommands createrawvmdk -filename /vmimages/Machines/loop1-imagefile.vmdk -rawdisk /dev/loop1Ĥ) Create the VM selecting the vmdk as the disk.Ħ) Write the raw image file to usb in sparse format: Losetup /dev/loop1 /vmimages/Raw-images/imagefile.rawģ) Create a raw vmdk defining the loopback device as a raw disk: Any advice or pointers would be gratefully appreciated.ĭd if=/dev/zero of=imagefile.raw bs=4096 seek=256x12000 count=0Ģ) link the raw image file to a loopback device: I've hunted round a number of sites and cherry picked what looks like an efficient solution. I need to create bootable usbs from a VM on a regular basis.
