Wednesday, July 28, 2010
1) Shut down the virtual machine you would like to copy
2) In File > Virtualdiskmanager, select the virtual machine disk image you would like to copy, and press the Release button and DELETE it from the menu BUT keep the image on the harddrive.
3) In a terminal window, issue following command (see virtualbox user manual):
vboxmanage clonevdi /directory/image1.vdi /directory/image2.vdi
4) In File > Virtualdiskmanager, add the new disk image you've created in step 3.
5) In the main virtualbox window, press the New button to create a new virtual machine, and link it to the new disk image you've created.
Saturday, July 24, 2010
(1)Install Java (run-time package is enough, but javac is a bonus, though I don't think I used javac in this setup). Note:install some new version, I used version 1.6.
(2)Download Axis C++ bin from Apache.org, decompress it. Note that there is a lib/axisjava folder and all the necessary Axis Java files used by Axis C++ are in there, so we don't have to download Axis Java anymore (however, if you try to use log4j you HAVE TO download Axis Java bin/src). And make sure in lib/axis there is already a wsdl2ws.jar in place, or you have to install ant and build the jar from source (which I didn't do)
(3)Edit CLASSPATH environment variable, here is my CLASSPATH variable
AXIS_C_HOME="type in your full directory path where Axis C++ bin is decompressed to"
Note: if you want to use log4j, it should be located in $
Friday, July 23, 2010
Creating your filesystem
Debian is suprisingly simple to install inside of user mode linux. To begin you must initialize the files using dd. This example assumes that your image files are /opt/uml/debian-root.
Now we will initialize the filesystems inside of each of these files. We will be using ext3 as our root filesystem.
Now we will need to mount the root filesystem before we run debootstrap.
Now we will install debootstrap and bootstrap a base Debian installation. This is a barebones installation that is less than 200 megs.
Example 8. Debian Installation
#apt-get install debootstrap
#debootstrap --arch i386 sarge /mnt/debian http://ftp.us.debian.org/debian
or you may want to use the breezy installation.
#debootstrap --arch i386 breezy /mnt/debian http://archive.ubuntulinux.org/ubuntu
At this point your system is an unconfigured base system. You will need to edit the following files in order to have your system in a valid configuration.
Example 10. Host configuration
You will need to make sure that /etc/hostname contains the following line or your nameing preference.
You will need to make sure that /etc/hosts contains the following line.
At this point you will need to setup your network interface configuration. This is done by editing the file /etc/network/interfaces. This guest will have a loopback network device. More information on configuring network devices under Debian can be found in the Debian Reference.
The above should be in the file /etc/network/interfaces. You'll also need to add a mirror or cdrom image to /etc/apt/sources.list
Example 12. /etc/securetty Configuration
#echo "tty0" >> /etc/securetty
#echo "ttys/0" >> /etc/securetty
Example 13. /mnt/debian/dev
In the breezy debootstrap example no node was created for me to mount the file system too, you can check this by,
If this does not return ubd0 then,
#mknod --mode=660 ubd0 b 98 0
#chown root:disk ubd0
Example 14. Edit /etc/inittab
This will allow you to login immediately after the boot messages
Comment out the following lines:
2:23:respawn:/sbin/getty 38400 tty2
3:23:respawn:/sbin/getty 38400 tty3
4:23:respawn:/sbin/getty 38400 tty4
5:23:respawn:/sbin/getty 38400 tty5
6:23:respawn:/sbin/getty 38400 tty6
Now modify tty1 to say tty0, the result should look like this:
1:2345:respawn:/sbin/getty 38400 tty0
#2:23:respawn:/sbin/getty 38400 tty2
#3:23:respawn:/sbin/getty 38400 tty3
#4:23:respawn:/sbin/getty 38400 tty4
#5:23:respawn:/sbin/getty 38400 tty5
#6:23:respawn:/sbin/getty 38400 tty6
Example 15. Add user to the file system
Before you can log into the file system you must add a user to be ablet logi in with.
Aswer the following questions about the new user or press enter followed by a yes at the end
Tuesday, July 13, 2010
- Shut down the uml guest
- Make a backup of the file you want to resize.
- If you have any COW files which have the file you want to resize as a backing file then make a backup of the cow files, too.
- If you want to merge the cow file with uml_moo, do it now. Otherwise remove the cow file to avoid confusion.
- Make sure the filesystem is in a clean state.
host% e2fsck -f filename
- Resize the file.
dd if=/dev/zero of=filename bs=1 count=1 seek=newsize conv=notrunc
0+0 Records in
0+0 Records out
- Resize the filesystem.
host% resize2fs -p filename
- If you don't trust your luck and/or your computer run:
host% e2fsck -f filename
- Start the uml with the new filesystem
Wednesday, July 7, 2010
(2)install python, in Debian/Ubuntu, run apt-get install python
(3)install uml-utilities package. NOTE: uml_utilities relies on several dependencies. Run apt-get install libreadline5-dev and apt-get install libfuse-dev
in Debian/Ubuntu, run apt-get install uml-utilities
this is a rather old copy of this package, see below for a newer revision
alternatively, download & install the UML utilities package from the UML mini-HOWTOs page
if that link doesn't work, try http://user-mode-linux.sourceforge.net/downloads.html
or use locally cached copy at the above website
build using make all and make install DESTDIR=/
in Debian/Ubuntu, run apt-get install xterm. NOTE: in Debian, X11 forwarding will not work if the xauth application is missing
run apt-get install xorg to make sure xauth is properly installed
(5)install GNU screen
in Debian/Ubuntu, run apt-get install screen
(6)install Virtual Distributed Ethernet (vde) package
this package includes the vde_switch application, which is used for establishing network connectivity between UML instances
in Debian/Ubuntu, run apt-get install vde2
alternatively, see the VDE homepage and download the latest version of vde2 or download a locally cached copy from the above website
(7)install the pre-compiled UML kernel binary, or optionally compile your own UML kernel
download uml_linux-22.214.171.124.bz2 from the above website: linux 126.96.36.199 pre-compiled UML kernel
install this file into a directory such as /a/uml/debian and run bzip2 -d to decompress
(8)install custom UML root filesystem
download Debian-4.0-x86-root_fs-2008Dec10.bz2 — Debian 4.0 x86 root filesystem + dragon-sw (144 MBytes) from the above website
install this file into a directory such /a/uml/debian and run bzip2 -d to decompress
download VNE-snapshot-2009Jan12.tar.bz2 from the above website: Virtual Network Experiments (VNE) snapshot as of 2009-Jan-12 (this version is patched to work with vde_switch)
decompress this file into a directory such as /home/dragon
install the dependency sudo apt-get python-setuptools, the link in the VNE package is invalid.
install: cd /home/dragon/VNE-snapshot-2009Jan12/src; python setup.py install
(1)This example assume the following structure:
everything is running as user "dragon"
location of root filesystem: /a/uml/debian/Debian-4.0-x86-root_fs
location of UML kernel binary: /a/uml/debian/uml_linux
(2)Create the file ~/.vnerc (in your home directory) that contains the following, changing any paths as needed for your system. The defaults are contained in a text file called VNEDefaults.cfg within the VNE distribution.
kernel = /a/uml/debian/uml_linux
filesystem = /a/uml/debian/Debian-4.0-x86-root_fs
fstype = cow
xmllint = /usr/bin/xmllint
screen = /usr/bin/screen
xterm = /usr/bin/xterm
uml_switch = /usr/bin/vde_switch
memorysize = 64
logdir = /home/dragon/uml
removecow = True
tap_device = tap0
(3)Use which to find the location of the binaries on your system, e.g. which screen
default location for screen binary is /usr/bin on Debian/Ubuntu
default location for xterm binary is /usr/bin on Debian/Ubuntu
default location for vde_switch binary is /usr/bin/vde_switch on Debian/Ubuntu
vde_switch will be located at /usr/local/bin/vde_switch if you build/install vde2 from source (by default)
(4)If your system has a lot of memory, you can change memorysize to a higher number. This will allow you to perform development work, e.g. re-compiling the DRAGON software. We recommend setting memorysize to 256 or 512 for development work.
(5)Set UML kernel binary to be executable: chmod +x /a/uml/debian/uml_linux-188.8.131.52
This is where the copy-on-write (COW) files will be placed, one for each UML instance
COW files contain changes/diffs to the read-only root filesystem (so they allow for a full read-write root partition in UML
Next is the steps I took to get it working:
(1)suppose the file system we use is /a/uml/Debian/Debian-4.0-x86-root_fs as mentioned above. Let's mount it and chroot it to make some changes to it.
(2)the first thing I found out is: Debian-4.0-x86-root_fs will not work out of the box. you have to rebuild and reinstall the DRAGON software suite contained in it. Let's do these:
sudo mkdir Debian
sudo mount /a/uml/Debian/Debian-4.0-x86-root_fs /mnt/Debian -o loop
sudo chroot /mnt/Debian
Now we're root inside Debian-4.0-x86-root_fs. Let's rebuild and reinstall DRAGON:
sudo mount -t proc proc /proc (mount this or there will be error when building DRAGON)
sudo ./do_build.sh vlsr-linux
when CLI prompt comes out, type: shell (NOTE: IMPORTANT!!! because the default is none)
then click enter twice to ignore user name and psword.
after the building:
Now let's make some changes to the configurations files
sudo vi .bashrc
add this line at the end of .bashrc file and save it:
so the narb will not crash when you click backspace.
then for p2p test xml file, we have to add another port for vlsr1 and vlsr2:
sudo vi genDragonConfig.pl
locate the line:
"set local-id port 1"
add the line below under the above line:
"set local-id port 6"
and save it.
NOTE: you can use "brctl show" in vlsr1/vlsr2 to see the bridge after the bridge is setup and use "/dragon_installation_file_folder/dragon-sw/utils/show-linux-switch-ports.pl" to see the port/switch connection. Also the log files are in /var/log including RSVPD.log and etc. these log files could be great resources for debugging
Finally, to test p2p mode:
sudo VNE config-narb-intra-p2p-csa.xml
open vlsr1, type in:
telnet localhost 2611
edit lsp test
set source ip 10.0.0.3 port 6 destination ip 10.0.0.4 port 6
set bandwidth eth100M swcap l2sc enc eth gpid eth
set vtag any
commit lsp test
wait for a while then type in
see if it is "IN service"