[EMAIL PROTECTED] wrote ---
> i'm trying to get uml working with modules.  i downloaded
the latest kernel
> 2.6.17.13, compiled using the `defconfig', obtained the
root fs from
> http://uml.nagafix.co.uk/Debian-3.1/ (which claims to have
been updated sept
> 13 2006), and ran ./linux.
> 
> note, my host machine is running 2.6.10.5, ubuntu 5.04
"hoary hedgehog".
--- End of quote ---

You need to do the following to get networking to work (note
that this is under dapper drake, so you may need to upgrade
the host.  It works with breezy badger guests though).

host:
make sure appropriate packages are installed (uml-utilities
 kernel-patch-skas screen).
add the user who is running the guest to the group uml-net
make a directory as root under /etc/uml
modify your /etc/rc.local file to be as follows:

# Set up UML Networking

# make it so umls can use taptun
chown root:uml-net /dev/net/tun

# make the host forward low level ip packets from umls to
local subnet
# This lets routers and stuff know how to find the uml
echo 1 > /proc/sys/net/ipv4/ip_forward

# Crank up the UMLs
/etc/uml/#INSERT VM MACHINE NAME HERE#.sh
exit 0

Under /etc/uml create a shell script and make it executable.
 Name it #INSERT VM MACHINE NAME HERE#.sh and make it read
as follows, replacing user names and ip addresses as
appropriate:

#!/bin/sh -e

# Set global variables
HOST_IP="192.168.1.51"
GUEST_IP="192.168.1.11"

# make a tap interface (fake ethernet link that the host and
guest communicate via
tunctl -u jmeyer -b -t jmeyertap
ifconfig jmeyertap $HOST_IP up netmask 255.255.255.255

# tell the host how to talk to the uml
route add -host $GUEST_IP dev jmeyertap

# make the host forward low level ip packets from umls to
local subnet
# This lets routers and stuff know how to find the uml
echo 1 > /proc/sys/net/ipv4/conf/jmeyertap/proxy_arp

# now do it back the other way to the uml
arp -Ds $GUEST_IP eth0 pub

# Crank up UMLs
screen -d -m -S jmeyer su - jmeyer -c "cd /home/jmeyer ;
/usr/bin/linux ubd0=root_fs ubd1=swap eth0=tuntap,jmeyertap
mem=1G"

Name the root_fs "root_fs" and put it in the home directory
of the user.
Use dd to make a swap file:
dd if=/dev/zero of=swap bs=1G seek=1 count=0
(Note that this makes a sparse swap file, which could be
VERY BAD if the host runs out of disk space and the swap
file isn't full size yet).
mkswap swap

Change /etc/fstab to make your /tmp use tmpfs.  Otherwise
your guests' memory will be on disk, which is very slow.

Now boot the uml (you don't have to restart, you can just
"sudo /etc/rc.local ; sudo /etc/uml/#INSERT VM NAME HERE#.sh").

use screen -r to get to the uml bootup messages. (Use
ctrl-a, ctrl-d to get out again).

Now that you are in the guest, you need to set up the guest
side of networking.  Edit /etc/resolv.conf to point at a
nameserver that is valid for you.  Edit
/etc/network/interfaces as follows (.11 is my guest, and .51
is my host, so change the file so that it works for your ip
addresses).

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
        address 192.168.1.11
        netmask 255.255.255.0
        up route add -host 192.168.1.51 dev eth0
        up route add default gw 192.168.1.51
        down route del -host 192.168.1.51 dev eth0
        down route del default gw 192.168.1.51

bring up eth0 (ifup eth0) and everything should be all set.

Jonas

P.S.  It is my understanding that modules on guests are a
bad thing because then if the guest kernel changes you have
to start fiddling with root filesystems.

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
User-mode-linux-user mailing list
User-mode-linux-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-user

Reply via email to