4 screen
='/usr/bin/screen';
7 cd /mnt
/data
2/uml
/; #directory to work in
8 umluser
='vserver'; #Setuid before run vserver
9 umldelay
='10'; #Delay (man sleep) before restart after vserver halt/fail
10 umldir
='/mnt/data2/uml/umldir'; #Directory for umid & pid files
13 hostnic
='eth1'; #network interface to operate on
14 umlbridge
='br0'; #name of bridge between real network and UMLs
15 hostip
='192.168.2.163'; #ipadres of host
16 hostmask
='255.255.255.0'; #netmask of host
17 hostgw
='192.168.2.1'; #default gw of host
20 uml_machines
() { #list of UML machines to be executed
21 #new_uml respawn umlkernel umlrootimg umlmem umlnice umllog tapnic umlmac
22 #new_uml true linux.uml debtest.img 64M 10 /dev/null tap0 fe:fd:c0:a8:02:89
23 new_uml true
/opt
/uml
/linux-2.6
.24-rc7 debtest.img
64M
10 log0.txt tap0 fe
:fd
:c0
:a8
:02:89
26 ############################################################
29 !!!!!!YOU MAY NEED TO SETUP YOUR GUEST OS!!!!!!!
30 !!!!!!!!!!OR YOU CAN USE DHCP INSTEAD!!!!!!!!!!!
31 root@uml# cat /etc/network/interfaces
34 iface lo inet loopback
37 iface eth0 inet static
38 address YOUR.ADD.RESS.HERE
41 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
44 ############################################################
46 echo [i
] Initializing tuntap networking...
49 echo [i
] Initializing
"$umlbridge" bridge...
50 ifconfig
"$hostnic" 0.0.0.0 promisc up
51 brctl addbr
"$umlbridge"
52 brctl setfd
"$umlbridge" 0
53 brctl sethello
"$umlbridge" 0
54 brctl stp
"$umlbridge" off
56 echo [i
] Adding
"$hostnic" interface to
"$umlbridge" bridge...
57 ifconfig
"$umlbridge" "$hostip" netmask
"$hostmask" up
58 route add default gw
"$hostgw"
59 brctl addif
"$umlbridge" "$hostnic"
61 echo [!] Now launching all UML Machines...
64 echo [!] Failed. Not enough parameters
for this machine.
;
78 tunctl
-u "$umluser" -t "$tapnic"
80 echo [i
] Adding
"$tapnic" interface to
"$umlbridge" bridge...
81 ifconfig
"$tapnic" 0.0.0.0 promisc up
82 brctl addif
"$umlbridge" "$tapnic"
84 #echo [R] Sleeping 120 before REBOOT.... #DEBUG FEATURE
89 echo [S
] Starting UML on
"$tapnic"...
91 #con0=fd:0,fd:1 con1=pty
92 #$screen -d -m su "$umluser" -c "nice -n $umlnice $umlkernel mem=$umlmem ubd0=$umlrootimg jail eth0=tuntap,$tapnic,$umlmac uml_dir=$umldir umid=$tapnic con0=fd:0,fd:1 con1=pty > $umllog 2>&1"
93 #su "$umluser" -c "$screen -d -m nice -n $umlnice $umlkernel mem=$umlmem ubd0=$umlrootimg jail eth0=tuntap,$tapnic,$umlmac uml_dir=$umldir umid=$tapnic con0=fd:0,fd:1 con1=pty > $umllog 2>&1"
94 #nice -n "$umlnice" su "$umluser" -c "$screen -d -m $umlkernel mem=$umlmem ubd0=$umlrootimg jail eth0=tuntap,$tapnic,$umlmac uml_dir=$umldir umid=$tapnic con0=fd:0,fd:1 con1=pty > $umllog 2>&1"
96 nice
-n "$umlnice" su
"$umluser" -c "$screen -d -m bash -c '
98 $umlkernel mem=$umlmem ubd0=$umlrootimg jail eth0=tuntap,$tapnic,$umlmac uml_dir=$umldir umid=$tapnic con0=fd:0,fd:1 con1=pty > $umllog 2>&1;
100 if ( $respawn ); then continue; fi; break;
106 echo [!] All UML Machines launched.