Running from USB

This is for discussing general topics about how to use VirtualBox.
skinnny
Posts: 11
Joined: 27. Jul 2011, 15:10
Primary OS: MS Windows XP
VBox Version: OSE other
Guest OSses: Ubuntu

Running from USB

Post by skinnny »

Sorry if this has been answered many times before.... I did search!

Is it possible to create a VM (sorry if that's not the right term...but I hope you know what I mean) on a USB stick and run if from whatever host the stick is plugged into (as long as the host has VirtualBox installed obviously)?

I would like to have an Ubuntu install on the USB stick and be able to run it on my work PC (XP) and also my home PC (Ubuntu).

Regarding speed issues: I'm not that bothered as I'll be working from the console mainly, but would there be significant issues and would USB 3.0 significantly improve things?

Thanks
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Running from USB

Post by Perryg »

Yes.
Create the original on one and set the storage to the USB drive at creation. Then add a new guest to the second PC and when creating and asked to make a new HDD or use an existing one, select the existing one.

Keep in mind that when the guest is missing VirtualBox will complain about it.
skinnny
Posts: 11
Joined: 27. Jul 2011, 15:10
Primary OS: MS Windows XP
VBox Version: OSE other
Guest OSses: Ubuntu

Re: Running from USB

Post by skinnny »

Ah excellent! Thank you :)
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: Running from USB

Post by mpack »

Also bear in mind that Windows occasionally reassigns drive letters, which will mess up paths to files on the USB drive.
skinnny
Posts: 11
Joined: 27. Jul 2011, 15:10
Primary OS: MS Windows XP
VBox Version: OSE other
Guest OSses: Ubuntu

Re: Running from USB

Post by skinnny »

Thanks for the heads up.

So I tried achieving what I outlined in my original post, but it didn't quite work out.

First some details:
- The USB stick is a 32GB USB 3.0 (but plugged into a 2.0 port) Adata drive formatted as exFAT (to allow for >4GB file size)
- The host OS is Windows XP SP3
- The guest OS is Ubuntu 11.04 32bit

I was able to create and start a VM on the USB stick...although it took a couple of hours to create the (fixed-space) virtual drive.

However, after getting about two thirds of the way (according to the progress bar) through the Ubuntu install, the VM process crashed (ie with a Windows "Send error report?" pop-up dialog). The virtualbox manager was still running.

While Ubuntu was installing, I did notice one of the drive activity icons (can't remember which one) flash red (as well as green) sometimes. Does that indicate an error?

Should I disable some USB stuff because the VM is running from the USB stick?

Is it an issue that the drive is formatted as exFAT (which requires third party drivers in Ubuntu) or should that be irrelevant the guest OS is looking at a virtual drive?

I think the virtual drive was SATA. Should/could it have been IDE?

Also, I was installing Ubuntu from an iso mounted as a CD drive using the virtualbox manager.

Sorry I haven't got more info (I was in a rush yesterday), I'll try again today and pay more attention!

Thanks.
skinnny
Posts: 11
Joined: 27. Jul 2011, 15:10
Primary OS: MS Windows XP
VBox Version: OSE other
Guest OSses: Ubuntu

Re: Running from USB

Post by skinnny »

Ok tried again with slightly different results.

This time the Ubuntu installer crashed, with the following error:
The installer encountered an error copying files to the hard disk:

[Errno 5] Input/output error: '/target/usr/share/pnm2ppa/pnm2ppa.conf'

This is often due to a faulty hard disk. It may help to check whether the hard disk is old and in need of replacement, or to move the system to a cooler environment.
The VM did not crash tho.

I did see the red dot on the drive icon again at various points. The icon was the one showing a stack of disks.

Any ideas?

Thanks!
skinnny
Posts: 11
Joined: 27. Jul 2011, 15:10
Primary OS: MS Windows XP
VBox Version: OSE other
Guest OSses: Ubuntu

Re: Running from USB

Post by skinnny »

I've got the log file, but it's too big to post/attach apparently!
skinnny
Posts: 11
Joined: 27. Jul 2011, 15:10
Primary OS: MS Windows XP
VBox Version: OSE other
Guest OSses: Ubuntu

Re: Running from USB

Post by skinnny »

Looking at the log, the only thing that looks remotely error-ish (to my untrained eye) is this:

00:09:08.086 PATM: Disable block at c17a21ed - invalid write c17a2a9c-c17a2aa0

Which occurs about a third of the way through the log in the middle of thousands of lines similar to this:

00:09:11.613 AsyncCompletion: Task 0x12468640 completed after 11 seconds
BillG
Volunteer
Posts: 5106
Joined: 19. Sep 2009, 04:44
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows 10,7 and earlier
Location: Sydney, Australia

Re: Running from USB

Post by BillG »

That looks like a routine system message to disable a block which is faulty. I can understand that creating a fixed vitual hard drive took a while! Write times on USB sticks is not fast.

What you are aiming at should work. I have not done it with a USB stick but I have with a removable USB hard drive. The only thing to watch out for is the drive letter problem which mpack mentioned.
Bill
BillG
Volunteer
Posts: 5106
Joined: 19. Sep 2009, 04:44
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows 10,7 and earlier
Location: Sydney, Australia

Re: Running from USB

Post by BillG »

And yes you need to be careful assigning USB devices. If you accidently assign the USB device which has your .vdi file on it to the vm, the vm will crash (because the host can't read the .vdi any more).
Bill
skinnny
Posts: 11
Joined: 27. Jul 2011, 15:10
Primary OS: MS Windows XP
VBox Version: OSE other
Guest OSses: Ubuntu

Re: Running from USB

Post by skinnny »

Thanks Bill!

At least I know it (or something very similar) can be done.

What file system was your drive formatted with btw?
skinnny
Posts: 11
Joined: 27. Jul 2011, 15:10
Primary OS: MS Windows XP
VBox Version: OSE other
Guest OSses: Ubuntu

Re: Running from USB

Post by skinnny »

I was reading this other thread (http://forums.virtualbox.org/viewtopic.php?f=1&t=43429) earlier. I don't know if I'm understanding it correctly, but I infer from it that it's possible to use a physical drive, instead of a vdi. Would it be worth trying that? Maybe the translation layer (between virtual and physical) is problematic on FAT/USB setups? Yes I'm clutching at straws here :)
levk
Posts: 33
Joined: 13. Apr 2011, 22:35
Primary OS: Ubuntu other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: XP, Gentoo, Ubuntu*, CentOS, Scientific Linux

Re: Running from USB

Post by levk »

skinnny wrote:I was reading this other thread (http://forums.virtualbox.org/viewtopic.php?f=1&t=43429) earlier. I don't know if I'm understanding it correctly, but I infer from it that it's possible to use a physical drive, instead of a vdi. Would it be worth trying that? Maybe the translation layer (between virtual and physical) is problematic on FAT/USB setups? Yes I'm clutching at straws here :)
If you have a FAT32 formatted USB and you asked it to make a file over 4GB, well that's your problem.

I haven't tried anything like this myself, but what would be the problem with creating a VM and when it asks to create a boot drive or use existing one, simply uncheck the drive box. It'll complain but create the VM anyway, then you can add the USB drive under USB devices and install directly.

Alternatively format NTFS or ext4 or whichever, FAT32 can't do files over 4GB.
skinnny
Posts: 11
Joined: 27. Jul 2011, 15:10
Primary OS: MS Windows XP
VBox Version: OSE other
Guest OSses: Ubuntu

Re: Running from USB

Post by skinnny »

levk wrote:If you have a FAT32 formatted USB and you asked it to make a file over 4GB, well that's your problem.

I haven't tried anything like this myself, but what would be the problem with creating a VM and when it asks to create a boot drive or use existing one, simply uncheck the drive box. It'll complain but create the VM anyway, then you can add the USB drive under USB devices and install directly.

Alternatively format NTFS or ext4 or whichever, FAT32 can't do files over 4GB.
The drive is formatted as exFAT (not FAT32), which doesn't have the 4GB file size limit.

Could you expand a bit on your suggestion about creating the VM and adding the USB drive later? I don't immediately see how this will help my situation.

Thanks.
BillG
Volunteer
Posts: 5106
Joined: 19. Sep 2009, 04:44
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows 10,7 and earlier
Location: Sydney, Australia

Re: Running from USB

Post by BillG »

On the evidence you have supplied I think your problem is simply a faulty USB drive. It all points do hardware failures on the physical device.
Bill
Post Reply