Having my VMs on a USB key makes them slow

This is for discussing general topics about how to use VirtualBox.
Post Reply
tot94
Posts: 24
Joined: 9. Oct 2015, 11:56

Having my VMs on a USB key makes them slow

Post by tot94 »

Hello,

I was having storage problem on my computer hard drive recently so I decided moving my VMs to a USB key.
So the 3 VMDK were on my USB key : 1 Ubuntu, 1 Debian & 1 Windows 7.
But when all was done I decided launching one of these VM and it was terribly long, each of these VM are useless because there are very very slow now

Is it link to the fact that the VMDK are now stored on the USB key (NTFS) ?

Thanks
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Having my VMs on a USB key makes them slow

Post by mpack »

Of course. USB drives are slow, that's why they are not used internally. You don't even say that it's a USB3 drive, but even if it was, the throughput would be very poor compared to a proper SSD or even a mechanical drive. USB2 would be horrific.

Incidentally, if "USB key" means a USB flash drive, then those don't make good working media. They are primarily designed for transporting data and may overheat if written to continuously.

Incidentally, I'm not altogether sure why you raised this subject here. VirtualBox is an a normal application running on the host. It has no influence on the speed of host drives, regardless of type.
tot94
Posts: 24
Joined: 9. Oct 2015, 11:56

Re: Having my VMs on a USB key makes them slow

Post by tot94 »

Yes it is a USB 3 but it still make them very slow and useless !
Anyway, thanks for strengthen my doubts :)
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Having my VMs on a USB key makes them slow

Post by socratis »

tot94 wrote:Yes it is a USB 3 but it still make them very slow and useless !
I have a VM that is located on a USB3 (an OSX 10.13, if it matters). I have another OSX 10.13 VM, located on my internal SSD. Take a look at the time required to be presented with the login screen. The "HDA: Codec reset" is the last message in the log, right before I login and shut down the VM...

Booting from internal SSD
00:00:12.848767 HDA: Codec reset
Booting from external USB3
00:01:13.901852 HDA: Codec reset
12.8 seconds vs 73.9 seconds! That's about 6 (5.75 to be exact) times slower... :shock:
 Edit: The external USB device is a 200 GB, 2.5" Hitachi HD, pulled from a MacBookPro, with a JMicron ATA-to-USB3 bridge. 
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Having my VMs on a USB key makes them slow

Post by mpack »

Yep, people look at the basic throughput figures for USB3 and think that's a guide to expected performance. It isn't, because USB3 flash drive throughput is far from continuous. It's ping (delay), pong (delay). Plus I think USB3 accesses have to be serialized - i.e. only one active pipeline - whereas a good SSD can have hundreds or thousands of transactions pending at any moment. That allows the theoretical bandwidth to be more fully utilized.

Don't get me wrong. USB is brilliant for what it is, a universal communication channel for low to moderate speed external/portable peripherals.
michaln
Oracle Corporation
Posts: 2973
Joined: 19. Dec 2007, 15:45
Primary OS: MS Windows 7
VBox Version: PUEL
Guest OSses: Any and all
Contact:

Re: Having my VMs on a USB key makes them slow

Post by michaln »

USB3 storage devices may support UASP (USB Attached SCSI Protocol), which allows concurrent requests. It is something that also requires USB host controller and OS support. Storage attached to USB3 can be quite fast, even without UASP, if it is, say, an SSD plugged into a SATA to USB adapter. Can be.

More likely a USB stick uses slow flash with horrible write rates, not getting anywhere close to the theoretical USB3 bandwidth. There are huge performance differences between USB3 sticks, for reads and especially for writes.

As a rule of thumb, don't expect a $5 or $10 USB stick to be a speed demon. Not on this planet. What you can expect is that if you use it instead of a hard disk/SSD, it will die sooner rather than later.
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Having my VMs on a USB key makes them slow

Post by socratis »

I realized that I didn't actually talked about the external USB3 device that I used in my timing comparison. My message was edited to reflect that, but since edits != notifications, I'll post it here as well.

The external USB device is a 200 GB, 2.5" Hitachi HD, pulled from a MacBookPro, with a JMicron ATA-to-USB3 bridge.
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
Post Reply