Page 1 of 2
UML (User Mode Linux)

Posted:
Thu Mar 13, 2003 8:04 pm
by Void Main
http://user-mode-linux.sourceforge.net/
Anyone messed with it? I installed the usermode-linux RPM on my RH8 machine and then downloaded the Debian root file system and booted it up. I got networking going and created a swap partition, installed some stuff, etc.
I would like to be able to resize the root file system (the one I downloaded was only 100MB). It seems to be a little different than how VMware handles disks. With UML you have a single file for a partition rather than a disk. In VMware you have a single file for an entire disk that you can "fdisk" etc. fdisk and/or parted doesn't appear to work in UML. I just started with this an hour ago and I'm sure there's some easy way to grow the file system, just haven't found it yet.

Posted:
Fri Mar 14, 2003 7:53 am
by Calum
that looks really cool! there must be a lot of possibilities for this thing!
i like their attitude! look:
http://user-mode-linux.sourceforge.net/sdotm.html

Posted:
Fri Mar 14, 2003 10:11 am
by Tux
I'v enever used UMl, but ive heard of it but ill take a guess at what you could do.
Create a file of the size you want with
dd if=/dev/zero of=/path/to/umlfile bs=1024 count=xxxxxx
Then use cat to put the old image into the larger image.
I have no idea if that would work, will probably corrupt UML's filesystem but you could try.

Posted:
Fri Mar 14, 2003 10:23 am
by Void Main
I was thinking something along those lines but if you use "cat oldfs > newbiggerfs" it will just overwrite the new file with the old one and would be an exact copy of the old. Now I could create a zero file that is equal to the amount of space I want to add to the current file and then cat them together into a new file with the old file system file being the in front that may work:
# cat oldfs NewExtraZeroSpaceFile > newfs
I'll give it a shot but like I said, I can't run fdisk or parted on the whole disk. It doesn't show any existing disk partitions so I will make a presumptuous guess that a resize2fs will not work. We shall see.

Posted:
Fri Mar 14, 2003 11:00 am
by Void Main
Ok I got it. Here's what I did... I had downloaded the debian file system that was 100MB as I mentioned before. I renamed the file "debian_fs". I also had created a 100MB swap file and called it "debian_swap". My UML startup script looked like:
debian:
- Code: Select all
linux mem=64M ubd0=debian_fs ubd1=debian_swap eth0=ethertap,tap0,fe:fd:0:0:0:1,192.168.0.23
Now I wanted to play around and add 200MB to the size of the debian_fs ("/" filesystem when booted) so I just created a 200MB zero filled file and appended it to the old debian_fs file to create a new file:
$ dd if=/dev/zero of=zerofile bs=1M count=200
$ cat debian_fs zerofile > debian_fs.new
Now I modified my startup script to add the "debian_fs.new" as another device so I can resize the filesystem on it:
debian
- Code: Select all
linux mem=64M ubd0=debian_fs ubd1=debian_swap ubd2=debian_fs.new eth0=ethertap,tap0,fe:fd:0:0:0:1,192.168.0.23
Then I booted it up and ran:
# e2fsck -f /dev/ubd/2
# resize2fs /dev/ubd/2
which resized the partition from 100MB to 300MB. Then I shut down UML and replaced debian_fs with debian_fs.new and was in business. Don't know if this is the recommended way but it worked just fine...

Posted:
Fri Mar 14, 2003 11:02 am
by Tux
Good stuff. I'll try UML this weekend.

Posted:
Fri Mar 14, 2003 1:18 pm
by Void Main
Ok, just upgraded my UML instance to Debian sid and got synaptic working etc... Seems to work pretty well... I may set up a UML instance on the Void Web server and allow ssh logins. :)

Posted:
Sat Mar 15, 2003 12:58 am
by TheQuirk
Isn't the server old and fragile? Wouldn't that strain it a lot?

Posted:
Sat Mar 15, 2003 5:18 am
by Void Main
Just running a single UML instance doesn't seem to use up much in the way of resources (especially if it isn't actually being used :)). Now if I allowed anyone to do anything I can see some issues, mostly security related that I would have to think out and resolve. I don't believe I will actually follow through with allowing ssh access even though I was only going to set it up as a novelty.
Last night I set up Apache/PHP and bind in my Debian UML. I can see where a lot of security can easily be added by running exposed services in their own minimalistic UML instance.

Posted:
Sat Mar 15, 2003 6:28 am
by Void Main
Here's a
screenshot of my Debian Usermode Linux session. I installed Xnest and blackbox so I could get an X desktop session for my Debian UML session.

Posted:
Sat Mar 15, 2003 6:51 am
by Tux
Very Nice. Can I ask how much resources this uses, as I only have 128Mb of RAM (ugh) in my main PC at the moment. Would that be sufficient to have a little play around with UML?

Posted:
Sat Mar 15, 2003 7:01 am
by Void Main
Certainly that's plenty, especially if you use one of the stock file system downloads. I would suggest the Debian one. I have mine set to boot up with nothing running and only eats up like 7MB of RAM on the host side. That is of course until you start apps in your usermode environment which will take up a similar amount of resources as they would running them directly on the host side.

Posted:
Sat Mar 15, 2003 7:04 am
by Tux
I think i'll give it a shot then. I also think I need to buy more RAM because 128Mb is annoying me, since I used to use 256Mb.
I think I will buy 512MB of PC2700 next month


Posted:
Sat Mar 15, 2003 7:05 am
by Void Main
Yeah, 512 is what I run and I use every bit of that much of the time. :)

Posted:
Sat Mar 15, 2003 7:09 am
by Tux
I would've got some more sooner but i've been needing to spend money on my bike and birthday presents for family/friends and beer etc so i'm short of cash.
Most likely due to lack of a job.
Anyway, that's off topic. I'm going to set up my fileserver...