UMmisc

From Virtualsquare
Revision as of 18:48, 27 December 2012 by Renzo (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Ummisc is a module for miscellanous virtualizations

$ um_add_service ummisc

How to define virtual system identification (uname)

Mount a ummiscuname filesystem on an empty directory.

$ mount -t ummiscuname none /tmp/uname

The virtual file system mounted on /tmp/uname has several files:

$ ls /tmp/uname
domainname  machine  nodename  release  sysname  version

each one corresponds to a field of the struct utsname defined in uname (2). A write access to these files changes the correspondent field. It is thus possible to use commands like

$ echo "virtuous" > /tmp/uname/machine

or it is possible to change the values by using a standard editor like vi (1).

hostname (1) can also be used to change the computer name (inside the view).

$ hostname virtuous

Time relativity inside umview

It is also possible by umview to change the process perception of the time.

Mount a ummisctime filesystem on an empty directory.

$ mount -t ummisctime none /tmp/time

The virtual partition has the following files:

$ ls /tmp/time
frequency  offset

Offset is the difference (in second) between the time perceived by the processes running in the view and the system time (on Jan 1, 1973).

Frequency is the pace of the clock: 1 means that the frequency of the virtual clock is 1hz, 2 means 2hz (the virtual clock runs fast) and 0.5 means 0.5hz (it runs slow).

Standard command (like date(1)) can be used to change the virtual time.

$ date
Mon Jul 30 18:06:34 CEST 2007
$ date 073018062008
Wed Jul 30 18:06:00 CEST 2008
$ date
Wed Jul 30 18:06:03 CEST 2008
$

Offset and frequency can be changed by hand (editing the files), too. When the frequency get changed, offset get also modified to change just the pace. Offset get modified such that at the point of frequency change, the time using the old frequency is the same of the time at the new frequency.

If you have a clock on your desktop, run another one as a client of your view and change the frequency of the virtual time.

$ xclock -update 1 &
$ echo 0.5 >/tmp/time/frequency
..... the xclock runs slow
$ echo 2 >/tmp/time/frequency
...... the xclock runs fast!
Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox