vdi on tmpfs and/or raw access: where's the performance?

Discussions related to using VirtualBox on Linux hosts.

vdi on tmpfs and/or raw access: where's the performance?

Postby Elle Stone » 10. Jan 2008, 22:23

On this thread:

http://forums.virtualbox.org/viewtopic. ... ight=tmpfs

kilou and Technologov talk about using tmpfs as a place to put a windows swap file. Their goal is allow windows guest on linux host to either dynamically allocate ram to guest or to give the guest more than 2gb of ram. I have a slightly different goal. I'd like to give photoshop in my w2k VM on linux host a scratch disk that resides in my "extra" ram and or linux swap space (three 3gb swap partitions, one each on 3 sata drives, same priority so essentially "raided").

The photoshop "scratch disk" holds a kind of "dedicated swap" for photoshop exclusive use - photoshop doesn't use windows swap. But anyone needing to do repeated read and write to a large file (prior to saving a permanent copy elsewhere) would find a small disk entirely held in ram very useful.

I created a tmpfs and mounted it using the following command:

sudo mount -t tmpfs -o size=3G,nr_inodes=64 tmpfs /media/mytmp

From within the linux host I copied files disk to mytmp, mytmp to mytmp, mytmp to disk, all goes pretty rapidly.

I went to the Virtual Disk Manager and created a 2.51gb vdi on /media/mytmp, and attached it to my w2k vm, opened the vm, opened "computer management", formatted the new disk, went to the dos command line and copied some files over.

I didn't do actual timing, but seriously, copying half-gig files, I couldn't see a significant difference in time copying a file from one drive to another, whether virtual drive to tmpfs virtual drive, or virtual drive (vdi) to raw access drive (vmd) or tmpfs virtual drive to tmpfs virtual drive. Anyway I tried, the copy process is significantly slower than doing the same kind of transfers from within the linux host.

Perhaps I am not creating the "tmpfs" vdi correctly?

In this post,
http://forums.virtualbox.org/viewtopic. ... ht=ramdisk
Technologov suggests using a ramdisk. Guess I'll try that next.

Has anyone successfully used a tmpfs or a ramfs as a place to hold a vdi disk and thereby improved read/write on large files from within a windows guest on linux host? Any other suggestions on how to speed up read/write of large files?

Elle Stone
Posts: 26
Joined: 7. Jan 2008, 14:22

Re: vdi on tmpfs and/or raw access: where's the performance?

Postby Ingo » 15. Jan 2008, 12:39

I guess the bottleneck isn't the access to the hard disk but the management of two file systems.
User Manual chapter 9.9 wrote:With VirtualBox, this type of access is called “raw hard disk access”; it allows a guest operating system to access its virtual hard disk much more quickly than with disk images, since data does not have to pass through two file systems (the one in the guest and the one on the host).
I suggest to try using a raw host hard disk from a guest instead of a ram disk for the VDI file.
The simplest way to a complex system is to start with a simple system.
Posts: 731
Joined: 22. Aug 2007, 10:13
Location: Germany

Postby Elle Stone » 15. Jan 2008, 14:35

Ingo, thanks. I've already tried the raw access and truthfully it didn't make much difference. I'll probably try again, though.

Elle Stone
Posts: 26
Joined: 7. Jan 2008, 14:22

Return to VirtualBox on Linux Hosts

Who is online

Users browsing this forum: No registered users and 16 guests