| Unix Content | Register | FAQ | Calendar | Search | Today's Posts | Mark Forums Read |
|
#1
|
| Hi all, I'd like to set up a cpu/auth/file server for my home network. I already have a laptop server running Ubuntu 8.04, so the idea is to also get Plan 9 running on it, via lguest. It's mostly working, but I'm encountering a few problems. Here's what I've done so far (maybe it's excessive list every single step, but just in case...): 1. Grab relevant files. - Download 9lguestcpu.2.6.25.elf and RUNLGUEST from Ron's contrib directory - Get thx9.img out http://9grid.net/rminnich/src/lguest/thnx9.bz2 - Download the 2.6.25 kernel: linux-2.6.25.tar.bz2 (dated 2008-04-17; I tried the latest version, 2.6.25.16, but encountered the same problems that were reported in http://9fans.net/archive/2008/07/690) 2. Compile and install kernel - I start with the stock 2.6.25 kernel. I then copy in my current config (Ubuntu 2.6.24-19-generic), run 'make oldconfig', then answer the config prompts with mostly the defaults. - Then I configure the LGUEST, LGUEST_LGUEST, VIRTIO, etc. config entries as per the lguest.txt documentation. - Then I compile (here the debian way, with 'make-kpkg kernel_image kernel_headers'). - I also run 'make' in Documentation/lguest to get my 'lguest' binary. 3. Prepare host machine - Install the new kernel on the host machine and reboot. - modprobe lg syscall_vector=64 - iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE - echo 1 > /proc/sys/net/ipv4/ip_forward 4. Run Plan 9 in lguest - I modified RUNLGUEST so that the command is: ./lguest 256 9lguestcpu.2.6.25.elf --block=thx9.img --tunnet=192.168.19.1 'venti=#S/sd00/arenas;bootdisk=local!#S/sd00/fossil;bootargs=local!#S/sd00/fossil' - sudo ./RUNLGUEST Eventually it prompts for the filesystem, and I pick the default. Here is the output from that point onwards: root is from (tcp, il, local)[local!#S/sd00/fossil]: disk is #S/sd00/fossil AUTHENTICATE ... time... GET VENTI ENV! #S/sd00/arenas IN THERE AND nf is 1 F 0 is #S/sd00/arenas venti...configloopbackk!!!!!!!!!!!!!!!!!!!!!!!!!!! !! DID CONFIG LOOPBACK setenv venti to tcp!127.1!17034 fossil(#S/sd00/fossil)...version...time... init[0] = init init[1] = -c LGATTACH edev c0440b90 ctlr c0440dd0 LGINIT SETMAC: NO ETHERIN: devno 3 ring 0 irq 34 ETHEROUT: devno 3 ring 0 irq 35 lguestnetwork is ndb/dns: can't read my ip address rc (cpurc): null list in concatenation init: starting /bin/rc % Networking wasn't working at first. So I modified /lib/ndb/local so that the dns entry pointed to my router (192.168.1.1), and then I ran the following: % ip/ipconfig -g 192.168.19.1 ether /net/ether0 192.168.19.2 255.255.255.0 % ndb/dns -r And then I can resolve names and ping out. So far, so good, but there are three problems that I'm still trying to figure out: 1. How can I avoid having to manually configure networking each time I boot? 2. I can ping from the host machine to the lguest interface (192.168.19.2), but when I try to connect with drawterm the connection is refused. 3. lguest always runs at full CPU. How can I figure out why this is happening? (I don't feel comfortable running lguest for more than a few minutes at a time -- the laptop gets pretty hot.) Any advice or pointers on these issues would be greatly appreciated. Thanks! Alex -- Alex Lee |
|
#2
|
| OK, I see this note and am sorry this is not working well for you. I will try again this week to get this going. It's harder now as I'm now on a 64-bit machine and 64-bit lguest is not there. But I'll try to get you an answer. Sorry ron |
|
#3
|
| On Sun, Aug 24, 2008 at 4:23 PM, Alex Lee > Here's what I've done so far (maybe it's excessive list every single > step, but just in case...): not at all! > > 1. Grab relevant files. > > - Download 9lguestcpu.2.6.25.elf and RUNLGUEST from Ron's contrib directory > - Get thx9.img out http://9grid.net/rminnich/src/lguest/thnx9.bz2 > - Download the 2.6.25 kernel: linux-2.6.25.tar.bz2 (dated 2008-04-17; > I tried the latest version, 2.6.25.16, but encountered the same > problems that were reported in http://9fans.net/archive/2008/07/690) The linux kernel is very fluid nowadays, and 2.6.xx.yy is not always working as 2.6.22.yy++. It's frustrating. So: > > 2. Compile and install kernel > > - I start with the stock 2.6.25 kernel. I then copy in my current > config (Ubuntu 2.6.24-19-generic), run 'make oldconfig', then answer > the config prompts with mostly the defaults. > - Then I configure the LGUEST, LGUEST_LGUEST, VIRTIO, etc. config > entries as per the lguest.txt documentation. > - Then I compile (here the debian way, with 'make-kpkg kernel_image > kernel_headers'). > - I also run 'make' in Documentation/lguest to get my 'lguest' binary. > good. > 3. Prepare host machine > > - Install the new kernel on the host machine and reboot. > - modprobe lg syscall_vector=64 > - iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE > - echo 1 > /proc/sys/net/ipv4/ip_forward good. > > 4. Run Plan 9 in lguest > > - I modified RUNLGUEST so that the command is: > ./lguest 256 9lguestcpu.2.6.25.elf --block=thx9.img > --tunnet=192.168.19.1 > 'venti=#S/sd00/arenas;bootdisk=local!#S/sd00/fossil;bootargs=local!#S/sd00/fossil' > - sudo ./RUNLGUEST > > Eventually it prompts for the filesystem, that's encouraging. >and I pick the default. Here > is the output from that point onwards: > > root is from (tcp, il, local)[local!#S/sd00/fossil]: > disk is #S/sd00/fossil > AUTHENTICATE ... > time... > GET VENTI ENV! #S/sd00/arenas > IN THERE AND nf is 1 > F 0 is #S/sd00/arenas > venti...configloopbackk!!!!!!!!!!!!!!!!!!!!!!!!!!! !! > DID CONFIG LOOPBACK > setenv venti to tcp!127.1!17034 > fossil(#S/sd00/fossil)...version...time... > init[0] = init > init[1] = -c > LGATTACH edev c0440b90 ctlr c0440dd0 > LGINIT > SETMAC: NO > ETHERIN: devno 3 ring 0 irq 34 > ETHEROUT: devno 3 ring 0 irq 35 > lguestnetwork is see this line? It's a variable read in /rc/bin/cpurc. You can check that script and see how it can be set so that networking is a little better. More I do not recall and the machine is not nearby ... > ndb/dns: can't read my ip address > rc (cpurc): null list in concatenation > > init: starting /bin/rc > % > > Networking wasn't working at first. So I modified /lib/ndb/local so > that the dns entry pointed to my router (192.168.1.1), and then I ran > the following: > > % ip/ipconfig -g 192.168.19.1 ether /net/ether0 192.168.19.2 255.255.255.0 > % ndb/dns -r > > And then I can resolve names and ping out. So far, so good, but there > are three problems that I'm still trying to figure out: ok > > 1. How can I avoid having to manually configure networking each time I boot? Something has to answer a DHCP request from your guest. Can you run dhcpd on the host? > 2. I can ping from the host machine to the lguest interface > (192.168.19.2), but when I try to connect with drawterm the connection > is refused. Try restarting the listen? that's an odd one. If you telnet to the port from the host to the guest what do you see? > 3. lguest always runs at full CPU. How can I figure out why this is > happening? (I don't feel comfortable running lguest for more than a > few minutes at a time -- the laptop gets pretty hot.) hmm. I have not seen this one. Again, not sure why this is happening. But the halt may not be working. Possibly the API has changed -- not sure. ron |
|
#4
|
| On Sun, Aug 24, 2008 at 11:32 PM, ron minnich [snip] >> lguestnetwork is > > see this line? It's a variable read in /rc/bin/cpurc. You can check > that script and see how it can be set so that networking is a little > better. More I do not recall and the machine is not nearby ... > [snip] >> 2. I can ping from the host machine to the lguest interface >> (192.168.19.2), but when I try to connect with drawterm the connection >> is refused. > > Try restarting the listen? that's an odd one. If you telnet to the > port from the host to the guest what do you see? Ah, I see now. I added "lguestnetwork=NAT" to parameters in RUNLGUEST, and now both networking and drawterm are working great! >> 3. lguest always runs at full CPU. How can I figure out why this is >> happening? (I don't feel comfortable running lguest for more than a >> few minutes at a time -- the laptop gets pretty hot.) > > hmm. I have not seen this one. Again, not sure why this is happening. > But the halt > may not be working. Possibly the API has changed -- not sure. > > ron Let me know if there's any information that I can provide to help with this. Many thanks for all the hard work that you've put into doing this port. Best, Alex -- Alex Lee |
|
#5
|
| On Sun, 24 Aug 2008 23:58:21 -0500 "Alex Lee" > On Sun, Aug 24, 2008 at 11:32 PM, ron minnich > [snip] > >> lguestnetwork is > > > > see this line? It's a variable read in /rc/bin/cpurc. You can check > > that script and see how it can be set so that networking is a little Hello, I have gotten the lguest port working on the 2.6.25.0 kernel, it works mighty fine here. The load issue for me is only on plan9, on the host I can see with 'top' that the lguest guest isn't consuming all the cpu, so this might ust be a plan9 problem. I have also seen quite a few messages in /sys/log/cron i get a lot of lines saying: $sysname Aug 25 08:31:14 time went backward I found routed networking to be the simplest, nat gives me the creeps. So here is my way to start the lguest guest, I hope it will be helpful: ====snip #!/bin/bash set -x /root/bin/lguest --tunnet=$1 --block=/dev/mirror/plan9cpu \ 512 /home/johnny/9lguestcpu.2.6.25.elf 'bootargs=local!#S/sd00/fossil;sysname=9soul;bootdisk=local!#S/sd00/fossil' sleep 10 ip route add $3 via $1 dev $2 ip route del 192.168.0.0/24 dev $2 echo 1 > /proc/sys/net/ipv4/conf/$2/proxy_arp echo 1 > /proc/sys/net/ipv4/ip_forward echo 1 > /proc/sys/net/ipv4/conf/eth0/proxy_arp ====snip $1 is the host ip, $2 is the tap interface the guest will use, and $3 is the ip the guest will have. This method only works for static networking, also you will need to install the iproute2 utilities. These command also assume the your net is 192.168.0.0 netmask 255.255.255.0, change that to whatever suits you. Cheers, John > > better. More I do not recall and the machine is not nearby ... > > > [snip] > >> 2. I can ping from the host machine to the lguest interface > >> (192.168.19.2), but when I try to connect with drawterm the connection > >> is refused. > > > > Try restarting the listen? that's an odd one. If you telnet to the > > port from the host to the guest what do you see? > > Ah, I see now. I added "lguestnetwork=NAT" to parameters in RUNLGUEST, > and now both networking and drawterm are working great! > > >> 3. lguest always runs at full CPU. How can I figure out why this is > >> happening? (I don't feel comfortable running lguest for more than a > >> few minutes at a time -- the laptop gets pretty hot.) > > > > hmm. I have not seen this one. Again, not sure why this is happening. > > But the halt > > may not be working. Possibly the API has changed -- not sure. > > > > ron > > Let me know if there's any information that I can provide to help with > this. Many thanks for all the hard work that you've put into doing > this port. > > Best, > Alex > > |
|
#6
|
| > Hello, > I have gotten the lguest port working on the 2.6.25.0 kernel, it works mighty fine here. > The load issue for me is only on plan9, on the host I can see with 'top' that the lguest guest isn't consuming all the cpu, so this might ust be a plan9 problem. I have also seen quite a few messages in /sys/log/cron i get a lot of lines saying: > $sysname Aug 25 08:31:14 time went backward both the excessive load and these messages sound like a timesync problem. - erik |
|
#7
|
| On Mon, Aug 25, 2008 at 3:56 AM, erik quanstrom >> Hello, >> I have gotten the lguest port working on the 2.6.25.0 kernel, it works mighty fine here. >> The load issue for me is only on plan9, on the host I can see with 'top' that the lguest guest isn't consuming all the cpu, so this might ust be a plan9 problem. I have also seen quite a few messages in /sys/log/cron i get a lot of lines saying: >> $sysname Aug 25 08:31:14 time went backward > > both the excessive load and these messages sound like a timesync problem. > yeah, that's really weird. One option is to set up the kernels without any fancy timers -- just use the old PC timers. ron |
|
#8
|
| >> both the excessive load and these messages sound like a timesync problem. >> > > yeah, that's really weird. One option is to set up the kernels without > any fancy timers -- just use the old PC timers. do you think that's the problem? time jumping backwards doesn't seem like something that could be traced to some oddity of the lguest environment. (at least i lack the imagination to know how this could happen.) it sounds more like the traditional problem of having started two timsyncs. it any event, fixing timesync properly is likely to fix the excessive load problem. - erik |
|
#9
|
| Hello again, Well, i don't think I am starting two timesync, ps a shows only one: cpu% ps a |grep timesync bootes 77 0:00 0:00 92K Pread timesync I also can not write to /dev/rtc, so the timesync part of cpurc fails, this part in particular =========snip if(! ps|grep -s timesync) { aux/timesync -n pool.ntp.org if (test -e '#r/rtc') @ { sleep 10 # let timesync correct the time awk '{print $1}' /dev/time >'#r/rtc' # fix hw clock } & } ============= awk: i/o error occurred while closing /dev/stdout input record /dev/time:1 source line 1 I have also tried to compile the kernel by doing: cpu% fcp /n/sources/contrib/rminnich/lguest/lg25.tgz $home/src; cd $home/src; tar xzf lg25.tgz; cpu% mkdir src/boot cpu% mkdir src/ip cpu% mkdir src/pc cpu% mkdir src/port cpu% rc bin/rc/lguest cpu% mk 'conf=lguestcpu' ...... 8c -FTVw lgkbd.c .../port/portdat.h:536 dat.h:130 lgkbd.c:4 syntax error, last name: Tval mk: 8c -FTVw lgkbd.c : exit status=rc 887: 8c 889: error Any help would be appreciated, this timesync problem is causing me quite some headaches :-) Thanks John On Mon, 25 Aug 2008 10:59:37 -0400 erik quanstrom > >> both the excessive load and these messages sound like a timesync problem. > >> > > > > yeah, that's really weird. One option is to set up the kernels without > > any fancy timers -- just use the old PC timers. > > do you think that's the problem? > > time jumping backwards doesn't seem like something that could > be traced to some oddity of the lguest environment. (at least i > lack the imagination to know how this could happen.) it sounds > more like the traditional problem of having started two timsyncs. > > it any event, fixing timesync properly is likely to fix the excessive > load problem. > > - erik > > |
|
#10
|
| > Well, i don't think I am starting two timesync, ps a shows only one: If Xen is anything to go by, time keeping is a problem in virtualisation. And Erik is misguiding you :-) Thing is, if timesync is wresting with the clock as it seems to do if two instances are running, it does consume a lot of cpu time, according to experiences reported on this list. But it's possible that timesync is wrestling with the virtual executive rather than with another instance of itself. Would it hurt you to run without timesync? ++L |
|
#11
|
| hello, On Mon, 25 Aug 2008 20:54:53 +0200 lucio@proxima.alt.za wrote: > > Well, i don't think I am starting two timesync, ps a shows only one: > > If Xen is anything to go by, time keeping is a problem in > virtualisation. And Erik is misguiding you :-) > > Thing is, if timesync is wresting with the clock as it seems to do if > two instances are running, it does consume a lot of cpu time, > according to experiences reported on this list. But it's possible > that timesync is wrestling with the virtual executive rather than with > another instance of itself. > > Would it hurt you to run without timesync? will try, thanks :-) > > ++L > > John |
|
#12
|
| Hello. For one timesync couldn't write to the rtc, so I commented out the lines in cpurc. Well, here timesync is not the problem, time is reported incorrectly, and I do not really know how to set it. I tried echoing unix time into '#r' and /dev/rtc, with no luck: $sysname# ls -l /dev/rtc --rw-rw-r-- r 0 bootes bootes 0 Apr 23 20:43 /dev/rtc $sysname# echo -n '1219699386' > /dev/rtc echo: write error: permission denied (on the hostowners console) Also cron still spews messages flooding it's log with lines like this: Aug 26 02:29:41 time went backward Which might be related to time issues.. rgds On Mon, 25 Aug 2008 20:54:53 +0200 lucio@proxima.alt.za wrote: > > Well, i don't think I am starting two timesync, ps a shows only one: > > If Xen is anything to go by, time keeping is a problem in > virtualisation. And Erik is misguiding you :-) > > Thing is, if timesync is wresting with the clock as it seems to do if > two instances are running, it does consume a lot of cpu time, > according to experiences reported on this list. But it's possible > that timesync is wrestling with the virtual executive rather than with > another instance of itself. > > Would it hurt you to run without timesync? > > ++L > > |
|
#13
|
| I just realized that even one timesync is too much. You should not run any at all. The hardware clock is set from Linux and I don't even allow it to be set. It makes no sense to do that. So don't let timesync run. thanks ron |
|
#14
|
| Ok, still, it would be great to know how to set the time, as my time is way off (by more than 4 hours). Best++ John On Mon, 25 Aug 2008 15:44:39 -0700 "ron minnich" > I just realized that even one timesync is too much. You should not > run any at all. The hardware clock is set from Linux and I don't even > allow it to be set. It makes no sense to do that. > > So don't let timesync run. > > thanks > > ron > |
|
#15
|
| On Tue, Aug 26, 2008 at 1:44 AM, John Soros > Ok, still, it would be great to know how to set the time, as my time is way off (by more than 4 hours). > Best++ > John Hi again, A couple of updates: I'm getting the same cron messages and time problems that John is seeing. I've made sure that timesync isn't running. My lguest time is about 3.5 hours ahead of host time. As for the load issue: The full cpu usage that I was seeing earlier actually stops after a several minutes. After booting, ^T^Tp shows genrandom as Running. Several minutes later the cpu usage drops to near idle, and genrandom goes to Wakeme. Then every now and then (I'm not sure if anything in particular triggers it, or if just randomly happens) I see the cpu usage jump again, and I can see that genrandom is once again Running. Then after several minutes it stops again. When genrandom is running, stats shows a load of around 3000. Otherwise, load is always around 2000. The problem looks similar to this: http://9fans.net/archive/2006/03/588 -- except that the lguest instance works fine while genrandom is running. Is this genrandom behavior anything out of the ordinary? Alex -- Alex Lee |
|
#16
|
| On Mon, Aug 25, 2008 at 11:44 PM, John Soros > Ok, still, it would be great to know how to set the time, as my time is way off (by more than 4 hours). What's the time on your host (Linux) look like? Are you sure it's not a time zone setup issue? Is it always four hours? It should not be drifting. ron |
|
#17
|
| On Wed, Aug 27, 2008 at 7:28 PM, Alex Lee > The problem looks similar to this: > http://9fans.net/archive/2006/03/588 -- except that the lguest > instance works fine while genrandom is running. Is this genrandom > behavior anything out of the ordinary? > I don't think so. Genrandom make me want to look at using the hardware RNGs a few years ago, but then Intel killed firmware hub and the whole idea kind of went away. ron |
|
#18
|
| Hi again, 9fans On Wed, 27 Aug 2008 21:28:42 -0500 "Alex Lee" > On Tue, Aug 26, 2008 at 1:44 AM, John Soros > > Ok, still, it would be great to know how to set the time, as my time is way off (by more than 4 > > hours). Best++ > > John > > Hi again, > > A couple of updates: I'm getting the same cron messages and time > problems that John is seeing. I've made sure that timesync isn't > running. My lguest time is about 3.5 hours ahead of host time. > > As for the load issue: The full cpu usage that I was seeing earlier > actually stops after a several minutes. This is what i've been experiencing. This is fine, from the linux host, the guest takes a lot of load in the begginning, but then it calms down, and the load only goes up once in a while. From inside the guest, though, the load looks like it's maxed out all the tim. This might be because of time issues, though. As for the timezone issues, well, i have my timezon set up properly on the host, and in plan9 I did cp /adm/timezon/CET /adm/timezone/local. > > After booting, ^T^Tp shows genrandom as Running. Several minutes later > the cpu usage drops to near idle, and genrandom goes to Wakeme. Then > every now and then (I'm not sure if anything in particular triggers > it, or if just randomly happens) I see the cpu usage jump again, and I > can see that genrandom is once again Running. Then after several > minutes it stops again. > > When genrandom is running, stats shows a load of around 3000. > Otherwise, load is always around 2000. > > The problem looks similar to this: > http://9fans.net/archive/2006/03/588 -- except that the lguest > instance works fine while genrandom is running. Is this genrandom > behavior anything out of the ordinary? > > Alex > > John |
|
#19
|
| > As for the load issue: The full cpu usage that I was seeing earlier > actually stops after a several minutes. > ... > Is this genrandom > behavior anything out of the ordinary? /dev/random normally runs at 100% cpu after booting, and whenever its queue of random bytes is getting empty. Since it uses the clock to produce entropy, this might take longer than usual if your clock is behaving strangely. |
|
#20
|
| > > When genrandom is running, stats shows a load of around 3000. > Otherwise, load is always around 2000. > what are the other two processes that are constantly running? - erik |