Subject: Re: [vserver] Guest - problem on networking and exit
From: Nicolas Cadou <ncadou@cobi.net>
Date: Wed, 27 Aug 2008 13:44:58 -0400
Wed, 27 Aug 2008 13:44:58 -0400
Le August 27, 2008, Stephen Liu a écrit :
> Here I made a mistake on IP address.  I should put 192.168.0.111.
> Because 192.168.0.110 is the public IP of the Host.  Please advise how
> to correct it.  TIA

Edit /etc/vservers/vserver1/interfaces/0/ip and 
maybe /var/lib/vservers/vserver1/etc/hosts

>
> # vserver vserver1 exec ifconfig
> eth0      Link encap:Ethernet  HWaddr 00:0e:a6:f9:a3:5b
>           inet addr:192.168.1.110  Bcast:0.0.0.0  Mask:255.255.255.255
>           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
>           RX packets:36328 errors:0 dropped:0 overruns:0 frame:0
>           TX packets:24393 errors:0 dropped:0 overruns:0 carrier:0
>           collisions:0 txqueuelen:1000
>           RX bytes:53116428 (50.6 MiB)  TX bytes:1770151 (1.6 MiB)
>           Interrupt:50 Base address:0xe000
>
>
> # vserver vserver1 exec ping -c3 yahoo.com
> ping: unknown host yahoo.com

Maybe it's a DNS problem?

> Guest can't connect Internet.
>
>
> # vserver vserver1 exec nano /etc/network/interface
> # Used by ifup(8) and ifdown(8). See the interfaces(5) manpage or
> # /usr/share/doc/ifupdown/examples for more information.
> * end *

You don't need to configure networking from inside the guest.

> # vserver vserver1 exec ls /usr/share/doc/ifupdown/examples/
> bridge  check-mac-address.sh  generate-interfaces.pl.gz
> get-mac-address.sh  network-interfaces.gz  pcmcia
>
> Which example shall I follow?  bridge?  If YES, then I have to setup
> the /etc/network/interface on the Host first.

You most likely don't need a bridge.

> # vserver vserver1 stop
> Saving the system clock.
> Cannot access the Hardware Clock via any known method.
> Use the --debug option to see the details of our search for an access
> method.
> Stopping enhanced syslogd: rsyslogd.
> Asking all remaining processes to terminate...done.
> All processes ended within 1 seconds....done.
> Deconfiguring network interfaces...done.
> Cleaning up ifupdown....
> Unmounting temporary filesystems...umount: none: not found
> umount: /tmp: must be superuser to umount
> umount: none: not found
> umount: /tmp: must be superuser to umount
> failed.
> Deactivating swap...Not superuser.
> failed.
> mount: permission denied
> Will now restart.
> ifdown: shutdown eth0: Permission denied
> ifdown: shutdown eth0: Permission denied
> /usr/lib/util-vserver/vserver.stop: line 85: 19850 Killed
>    "${NICE CMD[@]}" ${USE VNAMESPACE:+$ VNAMESPACE --enter "$S CONTEXT"
> -- } $ VCONTEXT $SILENT OPT --migrate --chroot --xid "$S CONTEXT" --
> "${INITCMD STOP[@]}"
> Warning: Executing wildcard deletion to stay compatible with old
> scripts.
>          Explicitly specify the prefix length (192.168.1.110/32) to
> avoid this warning.
>          This special behaviour is likely to disappear in further
> releases,
>          fix your scripts!
> * end *
>
>
> Please advise how to fix the problem.  Thanks

Some init scripts in your guest shouldn't be called. I use the following 
command to clean my guests, at installation time, and also on a regular basis 
because some updates seem to put back the rc symlinks once in a while:

for s in \
  klogd hwclock.sh setserial urandom networking umountfs halt reboot \
  mountvirtfs mountall.sh mountnfs.sh ifupdown; \
do \
    vserver <guest> exec update-rc.d -f $s remove
done

> Furthermore if I want to run update/upgrade with another website other
> than http://ftp.de.debian.org/debian whether run;
>
> # vserver vserver1 exec apt-get update(or upgrade)
> http//ftp.xx.debian.org/debian ?

Yes, that's it. You could also used vapt-get on the host, which I sometimes 
use to update all vservers at once, like this:

vapt-get --all -- update
vapt-get --all -- dist-upgrade

-- 

Nicolas Cadou

Cobi Informatique Inc.
Tel: (450) 266-2420 (305)
Fax: (450) 266-2415


["application/pgp-signature" not shown]