Write a .vdi to a drive?

This is for discussing general topics about how to use VirtualBox.
Post Reply
Znupi
Posts: 9
Joined: 28. Aug 2008, 00:07

Write a .vdi to a drive?

Post by Znupi »

Would it be possible in any way to write a .vdi file (like an .iso file) to a drive? Especially an USB drive? Why I'm asking this is because I would like to configure some operating system (Archlinux?) in VirtualBox, put it ready configured on a stick and take it anywhere with me. Is that possible?
Znupi
Posts: 9
Joined: 28. Aug 2008, 00:07

Re: Write a .vdi to a drive?

Post by Znupi »

Anyone else think this could be a good idea? Maybe it could be done with the dd command?
vbox4me2
Volunteer
Posts: 5218
Joined: 21. Nov 2008, 20:27
Location: Rotterdam
Contact:

Re: Write a .vdi to a drive?

Post by vbox4me2 »

Its possible but it will run like a tbird on one cylinder.
Znupi
Posts: 9
Joined: 28. Aug 2008, 00:07

Re: Write a .vdi to a drive?

Post by Znupi »

vbox4me2 wrote:Its possible but it will run like a tbird on one cylinder.
Heh, funny! But why? Doesn't HAL detect hardware on start-up? And how would it be possible?
vbox4me2
Volunteer
Posts: 5218
Joined: 21. Nov 2008, 20:27
Location: Rotterdam
Contact:

Re: Write a .vdi to a drive?

Post by vbox4me2 »

This isn't hal related but performance, the VM hdd is nothing more then a file, you can use it just about anywhere.
Sasquatch
Volunteer
Posts: 17798
Joined: 17. Mar 2008, 13:41
Primary OS: Debian other
VBox Version: PUEL
Guest OSses: Windows XP, Windows 7, Linux
Location: /dev/random

Re: Write a .vdi to a drive?

Post by Sasquatch »

And if you put it on a USB drive, make sure that it supports big files. By default, USB drives are formatted with FAT or FAT32, which doesn't support files larger than 4 GB.
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org

Retired from this Forum since OSSO introduction.
Znupi
Posts: 9
Joined: 28. Aug 2008, 00:07

Re: Write a .vdi to a drive?

Post by Znupi »

I know that the .vdi file is just a file and that you can use it on any machine, but not any machine has VirtualBox installed, and that wasn't the point of my question.
I was talking about writing the contents of the .vdi file (the actual filesystem) on the USB stick. That way, the stick would be formatted the right way (using the right filesystem), it would have a MBR, etc.

What I was thinking of trying was getting the offData of the .vdi (using vditool or similar) and then copying everything after {offData} bytes to the stick, using dd (on Linux). Is there some reason why this would not work at all?
vbox4me2
Volunteer
Posts: 5218
Joined: 21. Nov 2008, 20:27
Location: Rotterdam
Contact:

Re: Write a .vdi to a drive?

Post by vbox4me2 »

Aha a raw format, yes thats possible but not advicable since the moment you stick in a usb stick in a windows Host the Host will access it and possibly write to it. A raw format requires exclusive access or you run a very high risk of corruption.
See the manual about raw disks.
Znupi
Posts: 9
Joined: 28. Aug 2008, 00:07

Re: Write a .vdi to a drive?

Post by Znupi »

Ah thanks! Yes, that's close to what I was looking for, but I'll settle with it.
So will a Windows host actually try to write to it if it doesn't even recognize the filesystem? Sheesh, I better be careful, good thing I use Linux :)
Post Reply