Running VMs in Porteus

Post here if you are a new Porteus member and you're looking for some help.
User avatar
tmsg
Black ninja
Black ninja
Posts: 44
Joined: 15 Sep 2015, 14:29
Distribution: arch, mx, porteus
Location: York, UK

Running VMs in Porteus

Post#1 by tmsg » 20 Nov 2015, 12:28

I want to run a couple of VirtualBox VMs under Porteus (64-bit). To that end, I have taken a fast 32GB USB3 stick, installed Porteus, compiled vbox and put the .xzm into porteus/modules/. This seems to be OK (I can start vbox and can create VMs etc).

I have not yet copied the "real" VMs (which, for test purposes, currently run under vbox on a Win7 64-bit host) to the USB stick as these are quite big (the .vdi files are around 4 to 8GB). The reason is that I am not quite clear about the best location for these files in the Porteus file system.

The USB stick currently has a single 32GB ext4 partition but I am thinking of creating two separate partitions, a small one (<1GB) to boot Porteus and a big one for the VM files. Is that a sound idea? If not, what else is? (I know that Windows normally doesn't support multiple partitions on USB sticks but that's no big deal as the stick will only ever by used for the VMs. At any rate, it is possible to circumvent that limitation.)

Thanks for all ideas and hints...

User avatar
Ed_P
Contributor
Contributor
Posts: 8341
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

Re: Running VMs in Porteus

Post#2 by Ed_P » 20 Nov 2015, 16:05

You could format the USB drive as FAT32, or exFAT. Then Porteus, the VMs and Windows would all have access to it and it will boot anywhere, BIOS or UEFI machines.

See this post: viewtopic.php?f=81&t=4632&p=33638#p33604
Ed

User avatar
francois
Contributor
Contributor
Posts: 6434
Joined: 28 Dec 2010, 14:25
Distribution: xfce plank porteus nemesis
Location: Le printemps, le printemps, le printemps... ... l'hiver s'essoufle.

Re: Running VMs in Porteus

Post#3 by francois » 21 Nov 2015, 12:27

Your vdi and images could be accessed from anywhere on the filesystem whether on your USB key or on the hdd.
Prendre son temps, profiter de celui qui passe.

User avatar
tmsg
Black ninja
Black ninja
Posts: 44
Joined: 15 Sep 2015, 14:29
Distribution: arch, mx, porteus
Location: York, UK

Re: Running VMs in Porteus

Post#4 by tmsg » 21 Nov 2015, 17:16

Perhaps I should say a few words about what I want to achieve with this.

The plan is to have a fast, tiny USB stick with Porteus64 + VBox64 + my VMs. This stick will be my "portable computer": wherever I am I just insert the stick into a (reasonable modern) PC (say in an internet cafe or with friends), boot from it and have (almost) my complete home environment at my fingertips. The more streamlined and "turnkey" I can make this system the better.

I've tested my current Porteus64 install with VBox 5.0.10 and a smaller VM on the USB stick. This works very well indeed on a variety of machines, so the basic idea is sound. The problem (or difficulty) is that my VM .vdi files are pretty big, some are around the 8GB mark. That's no problem in itself but given that the stick I am using is a) finite:-) and b) not a super fast harddisk I want this setup to be as efficient as possible.

So that's the reason why I was asking.

User avatar
Ed_P
Contributor
Contributor
Posts: 8341
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

Re: Running VMs in Porteus

Post#5 by Ed_P » 21 Nov 2015, 17:38

Well ext4 is a journaling format = overhead, so I don't recommend it for a flash drive.

Porteus64 won't run on 32-bit machines so that limits your portability, especially in cafes.

You need to balance your quest for portability with your quest for performance.

Multiple partitions means all VM file copying will need to be done from Porteus.

I still like my single partition exFAT format suggestion bootable on BIOS and UEFI machines. :good:
Ed

User avatar
tmsg
Black ninja
Black ninja
Posts: 44
Joined: 15 Sep 2015, 14:29
Distribution: arch, mx, porteus
Location: York, UK

Re: Running VMs in Porteus

Post#6 by tmsg » 21 Nov 2015, 18:31

Ed_P wrote:Well ext4 is a journaling format = overhead, so I don't recommend it for a flash drive.
Is that so much overhead that it's noticeably slowing things down? (I am a Linux newbie so I've not a lot of experience with the various Linux filesystems.)
Ed_P wrote:Porteus64 won't run on 32-bit machines so that limits your portability, especially in cafes.
Yeah, I know. That's why I wrote "reasonable modern". I've seen some pretty ghastly clunkers in Indian internet cafes but even these had mostly 64-bit CPUs (though probably not all with VT-x/VT-d).
Ed_P wrote:Multiple partitions means all VM file copying will need to be done from Porteus.
I am not sure what you mean. The VM files are copied only once to the stick and that is that.
Ed_P wrote:I still like my single partition exFAT format suggestion bootable on BIOS and UEFI machines. :good:
Well, the problem with that approach is that I'd then have to create a save.dat file to store any changes in the Porteus filesystem and as the (huge) .vdi files *will* get changed that seems a big no-no.

User avatar
Ed_P
Contributor
Contributor
Posts: 8341
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

Re: Running VMs in Porteus

Post#7 by Ed_P » 21 Nov 2015, 19:02

tmsg wrote:Is that so much overhead that it's noticeably slowing things down? (I am a Linux newbie so I've not a lot of experience with the various Linux filesystems.)
ext4 is similar to NTFS. Would you put NTFS on a flash drive? Will you notice the overhead, I don't know. You said you wanted fast so...
Yeah, I know. That's why I wrote "reasonable modern". I've seen some pretty ghastly clunkers in Indian intelrnet cafes but even these had mostly 64-bit CPUs (though probably not all with VT-x/VT-d).
Well modern machines can be UEFI bootable or BIOS bootable. Your flash drive will boot on BIOS machines if the BIOS's boot device order has USB drives before the hard drive. Your flash drive will not boot on UEFI machines unless it is reconfigured to boot in Legacy mode. Which means you will have to switch the config back when done. The brokenman approach that I linked to runs on UEFI systems with only the Secure Boot option disabled.

And while friends may allow you to tweak their BIOS/UEFIs I doubt cafes will.
Well, the problem with that approach is that I'd then have to create a save.dat file to store any changes in the Porteus filesystem and as the (huge) .vdi files *will* get changed that seems a big no-no.
Having not used VMs under Porteus I'm not sure how much of them has to be under the Porteus system as opposed to outside the system but accessible to it. Like the .vdi files. Yes, you would need a save.dat file for persistence, just not sure how much of your VMs would be in it. Especially if you use the changes=EXIT option for it.
Ed

User avatar
tmsg
Black ninja
Black ninja
Posts: 44
Joined: 15 Sep 2015, 14:29
Distribution: arch, mx, porteus
Location: York, UK

Re: Running VMs in Porteus

Post#8 by tmsg » 22 Nov 2015, 14:19

Ed_P wrote:
tmsg wrote:Is that so much overhead that it's noticeably slowing things down? (I am a Linux newbie so I've not a lot of experience with the various Linux filesystems.)
ext4 is similar to NTFS. Would you put NTFS on a flash drive? Will you notice the overhead, I don't know. You said you wanted fast so...
Sure, my bigger Windows USB sticks are mostly NTFS-formatted. I've never seen a *noticeable* speed difference between similar sticks, whether they're FAT or NTFS. (IMHO, a lot of time is wasted by premature attempts at optimisation, often based on theoretically valid arguments which happen to have little or no practical impact in the real world.)
Ed_P wrote:Having not used VMs under Porteus I'm not sure how much of them has to be under the Porteus system as opposed to outside the system but accessible to it.
Well, there's a way to find out. I could do a test install with the stick NTFS-formatted and with the .vdi files somewhere in the NTFS filesystem. This should work if VirtualBox can be configured to access files outside the live filesystem and if writes to those files by VirtualBox never end up in save.dat. I'll try this, time permitting, and will report back.

User avatar
tmsg
Black ninja
Black ninja
Posts: 44
Joined: 15 Sep 2015, 14:29
Distribution: arch, mx, porteus
Location: York, UK

Re: Running VMs in Porteus

Post#9 by tmsg » 23 Nov 2015, 10:49

tmsg wrote:Well, there's a way to find out. I could do a test install with the stick NTFS-formatted and with the .vdi files somewhere in the NTFS filesystem. This should work if VirtualBox can be configured to access files outside the live filesystem and if writes to those files by VirtualBox never end up in save.dat. I'll try this, time permitting, and will report back.
I've tried that and it works as I'd expect. Changes to .vdi files on the NTFS partition (ie outside the Porteus filesystem) are written in-place and are not clogging save.dat.

Nevertheless I am still thinking of a two-partition strategy with boot/Porteus as ext4 and the VM data on a second NTFS partition. I will probably open another thread about that sometime later.

In whatever way I finally do that I have to say that Porteus is EXACTLY what I was looking for: a fast, small, basic Linux system that will run VBox VMs (and, in the medium term, other stuff if I so decide). I am still not totally clear about various aspects of the system but then again I am a relative newcomer to Linux in general and Porteus in particular.

Post Reply