in computacion · plan9

User-space operating systems: vx32 and 9vx (part 2)

Where to get 9vx

In the previous post we announced the appearance of a distribution of the Plan 9 operating system from Bell Labs that could run as a user process, being for all intents and purposes a guest operating system on GNU/Linux, FreeBSD or MacOS X, thanks to the emulation layer of the vx32 libraries.

The distribution along with the binaries can be found at http://swtch.com/9vx/

[Update 9 March 2011]:

More up-to-date copies can be found in the mercurial repositories:

https://bitbucket.org/yiyus/vx32/

https://bitbucket.org/rminnich/vx32/

The latter is recommended. In the future it will end up being integrated into Russ Cox’s version.

hg clone https://bitbucket.org/rminnich/vx32

Installing 9vx

Anyone who has tried to install it may have run into a few problems. One of them was that the distribution did not contain all the files that come on the original Plan 9 installation CD, causing for example pull, the script we can run to update Plan 9 online, to fail because it could not find the plan9.db file that contains the list of files.

Russ Cox, the creator of 9vx, reported this on the 9fans list:

If you give 9vx a full Plan 9 distribution, you can use
pull to update it just like any other distribution.

Early copies of 9vx had a /dist/replica/client/plan9.db
but it didn't match all the files I'd deleted to cut the
size of the archive down.  In 0.12 I deleted the plan9.db
too, so that pull wouldn't try to run.

If you want to run pull, you should start with a full tree.
I have posted one at http://pdos.csail.mit.edu/~rsc/plan9.tar.bz2
You should be able to run pull successfully if you use
that tree as your root.

You can also start with a stock Plan 9 CD, if you know how
to extract it into your local file system, but you will need
to populate /dist/replica/client appropriately and also
copy /dist/replica/network from a 9vx tree, since I haven't
gotten those changes back into the distribution yet.

In short, he says that 9vx could use a full Plan 9 distribution, instead of the trimmed one, with which we could use pull again to update.

We have 2 options to do it.

  1. Use a copy of the “full tree” published here: http://pdos.csail.mit.edu/~rsc/plan9.tar.bz2
  2. Use the original plan9 CD http://plan9.bell-labs.com/plan9/ but bearing in mind that you would need an appropriate /dist/replica/client and to copy /dist/replica/network from the 9vx distribution (the one from step 1, or the previous post, for example).

At this point, in my case I went for option 1, and I found that when unpacking the file with tar on Debian GNU/Linux the file permissions were not correct, which later causes problems when running Plan9 with 9vx.

The solution is to unpack it with bsdtar (apt-get install bsdtar), or with the version of tar included in plan9port (p9p).

P9P or Plan 9 from User Space is a set of plan9 utilities and commands for GNU/Linux, *BSD, SunOS or Mac OS X systems. With these tools there will be no file permission problems when unpacking with:

$ 9 bunzip2 < plan9.tar.bz2 | 9 tar xv

And at last we can run Plan9 as a user process with:

9vx.Linux -u glenda

Note:

As an additional note, Andrey Mirtchovski published on the 9fans mailing list (http://plan9.bell-labs.com/wiki/plan9/mailing_lists/) how to unpack it with GNU tar (the one that GNU/Linux distributions usually ship).

$ tar jxvf plan9.tar.bz2 plan9/mnt/cons plan9/mnt/exportfs --mode 755
> /dev/null

[messages about ignored headers]

$ tar jxvf plan9.tar.bz2 --exclude plan9/mnt/cons --exclude

plan9/mnt/exportfs > /dev/null

[messages about ignored headers]

And if we had already unpacked the files without following the steps given in this post, to repair the files, until they are fixed in Russ Cox’s distribution:

$ find plan9 -not -perm -200 -print0 | xargs -0 chmod u+w