Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Gentoo vserver on kernel 2.6 Guide
View unanswered posts
View posts from last 24 hours

Goto page 1, 2  Next  
Reply to topic    Gentoo Forums Forum Index Gentoo Chat
View previous topic :: View next topic  
Author Message
Hollow
Developer
Developer


Joined: 05 Dec 2003
Posts: 34
Location: Berlin, Germany

PostPosted: Sun Nov 14, 2004 1:01 pm    Post subject: Gentoo vserver on kernel 2.6 Guide Reply with quote

Hi all!

Over the past few days i created a guide and some ebuilds to make installing vserver on gentoo more comfortable! As setting up gentoo as a guest system is somewhat tricky and documentation (especially for 2.6 kernels) is spread out all over the net i decided to write a guideline to help others. This guide is not complete yet, but you can get a basic vserver running.

Help is always appreciated!

You can find the guide at http://oss.croup.de/vserver/guide/

Happy testing :)

Hollow
Back to top
View user's profile Send private message
Hollow
Developer
Developer


Joined: 05 Dec 2003
Posts: 34
Location: Berlin, Germany

PostPosted: Sun Nov 14, 2004 8:18 pm    Post subject: Reply with quote

little update to save some work... look at the changelog for details
Back to top
View user's profile Send private message
Luxus
Tux's lil' helper
Tux's lil' helper


Joined: 21 Nov 2002
Posts: 98
Location: Germany / Frankfurt

PostPosted: Mon Nov 15, 2004 11:57 pm    Post subject: Reply with quote

thx for the nice guide.. perhaps you can seperate the guides...
a easy guide how to create a optimized gentoo template is interesting for other distro user..
my partner is debian fan but if i can easily create him an gentoo template perhaps he will try it..
Back to top
View user's profile Send private message
Hackeron
Guru
Guru


Joined: 01 Nov 2002
Posts: 307

PostPosted: Tue Nov 23, 2004 5:01 pm    Post subject: Reply with quote

Sorry, but how is this different from UserMode Linux?
Back to top
View user's profile Send private message
Q
Tux's lil' helper
Tux's lil' helper


Joined: 17 Apr 2002
Posts: 149
Location: Oxford, UK

PostPosted: Mon Nov 29, 2004 2:03 pm    Post subject: Reply with quote

Hi, I have followed the guide as far as I can see but I get the following error. I would appreciate some help in resolving this. Thanks

>vserver gentoo-template start
Starting the virtual server gentoo-template
Error: /proc must be mounted
To mount /proc at boot you need an /etc/fstab line like:
/proc /proc proc defaults
In the meantime, mount /proc /proc -t proc
Server gentoo-template is not running
ipv4root is now 192.168.1.11
New security context is 49153
* Caching service dependencies...
Error: /proc must be mounted
To mount /proc at boot you need an /etc/fstab line like:
/proc /proc proc defaults
In the meantime, mount /proc /proc -t proc
_________________
AMD 64 3200
Shuttle SN85G4/NForce 3 Chipset
Back to top
View user's profile Send private message
dmistry
n00b
n00b


Joined: 20 Nov 2004
Posts: 2

PostPosted: Thu Dec 09, 2004 4:49 am    Post subject: network configure error Reply with quote

I followed the great documentation and when I run the vserver start i get the following error can anyone help

[root@beast:/home/dmistry]$ vserver gentoo-template start
/usr/lib/util-vserver/vserver.functions: line 543: ip: command not found
/usr/lib/util-vserver/vserver.functions: line 545: ip: command not found
* Caching service dependencies ... [ ok ]
* Starting syslog-ng ... [ ok ]
* Loading key mappings ... [ ok ]
* Setting terminal encoding to ASCII ... [ ok ]
* Initializing random number generator ... [ ok ]
* Mounting network filesystems ... [ ok ]
* Starting vixie-cron ... [ ok ]
* Starting local ... [ ok ]

and i get no network
Back to top
View user's profile Send private message
ppierre
n00b
n00b


Joined: 17 Aug 2004
Posts: 35

PostPosted: Thu Dec 09, 2004 8:31 pm    Post subject: Reply with quote

I get same trouble.
Code:
emerge sys-apps/iproute2
Back to top
View user's profile Send private message
twarnick
n00b
n00b


Joined: 09 Dec 2004
Posts: 1

PostPosted: Fri Dec 10, 2004 5:22 pm    Post subject: Reply with quote

i have other trouble :(

engine-tw-nb ~ # vserver gentoo-template start
* Caching service dependencies...

engine-tw-nb ~ # vserver gentoo-template status
Vserver 'gentoo-template' is stopped

engine-tw-nb ~ # vserver-stat
CTX PROC VSZ RSS userTIME sysTIME UPTIME NAME
0 29 36.4M 4K 4m49s31 2m14s25 1h37m23 root server

engine-tw-nb ~ #

no error, but no vserver is started.
where can i look whats wrong ?
Back to top
View user's profile Send private message
pjp
Administrator
Administrator


Joined: 16 Apr 2002
Posts: 15989
Location: Colorado

PostPosted: Fri Dec 10, 2004 6:22 pm    Post subject: Reply with quote

Moved from Documentation, Tips & Tricks.
_________________
Safety is my gaol.
US Constitution | Amendments
Back to top
View user's profile Send private message
basty
n00b
n00b


Joined: 20 Dec 2004
Posts: 1

PostPosted: Tue Dec 21, 2004 1:43 am    Post subject: klogctl and /proc trouble Reply with quote

I did my best, please help

root@host:~ # vserver gentoo-template start
* Caching service dependencies...
klogctl: Operation not permitted [ ok ]
* Starting syslog-ng... [ ok ]
* Mounting network filesystems... [ ok ]
* Starting sshd... [ ok ]
* Starting vixie-cron... [ ok ]
* Starting local... [ ok ]
Error: /proc must be mounted
To mount /proc at boot you need an /etc/fstab line like:
/proc /proc proc defaults
In the meantime, mount /proc /proc -t proc

I tryed:
setattr --~hide /proc/uptime
and vserver-stat worked.
Back to top
View user's profile Send private message
Hollow
Developer
Developer


Joined: 05 Dec 2003
Posts: 34
Location: Berlin, Germany

PostPosted: Thu Dec 23, 2004 6:34 pm    Post subject: Reply with quote

i forgot to integrate vprocunhide in the init script

you can get it running by changing checkconfig() in your /etc/init.d/vservers to:

Code:
checkconfig() {
        : ${UTIL_VSERVER_VARS:=/usr/lib/util-vserver/util-vserver-vars}
        [ -e $UTIL_VSERVER_VARS ] || {
                eerror "Cannot find util-vserver installation"
                eerror "(the file '$UTIL_VSERVER_VARS' would be expected)"
                exit 1
        }
        . $UTIL_VSERVER_VARS

        $_VPROCUNHIDE

        : ${MARK:=default}
        : ${LOCKFILE:=/var/lock/vservers-$MARK}
        : ${NUMPARALLEL:=6}
}


The ip command not found issue will be solved by installing iproute2 as mentioned above...
I'll update the ebuilds soon.

There will also be some additions about shared portdir and andvanced network configuration soon, so be patient.


Last edited by Hollow on Thu Dec 23, 2004 6:37 pm; edited 1 time in total
Back to top
View user's profile Send private message
Hollow
Developer
Developer


Joined: 05 Dec 2003
Posts: 34
Location: Berlin, Germany

PostPosted: Thu Dec 23, 2004 6:35 pm    Post subject: Reply with quote

twarnick wrote:
i have other trouble :(

engine-tw-nb ~ # vserver gentoo-template start
* Caching service dependencies...

engine-tw-nb ~ # vserver gentoo-template status
Vserver 'gentoo-template' is stopped

engine-tw-nb ~ # vserver-stat
CTX PROC VSZ RSS userTIME sysTIME UPTIME NAME
0 29 36.4M 4K 4m49s31 2m14s25 1h37m23 root server

engine-tw-nb ~ #

no error, but no vserver is started.
where can i look whats wrong ?


make sure /var/lib/init.d/ inside your vserver is empty before you start it
Back to top
View user's profile Send private message
Hollow
Developer
Developer


Joined: 05 Dec 2003
Posts: 34
Location: Berlin, Germany

PostPosted: Thu Dec 23, 2004 6:39 pm    Post subject: Reply with quote

Luxus wrote:
thx for the nice guide.. perhaps you can seperate the guides...
a easy guide how to create a optimized gentoo template is interesting for other distro user..
my partner is debian fan but if i can easily create him an gentoo template perhaps he will try it..


I have plans to do this guide with Handbook GuideXML in order to get little pieces of howtos instead of one big one, but had much work lately, so again: be patient :)
Back to top
View user's profile Send private message
Kostko
Tux's lil' helper
Tux's lil' helper


Joined: 07 Jul 2003
Posts: 83

PostPosted: Fri Dec 31, 2004 2:06 pm    Post subject: Reply with quote

I also have a problem... the vserver starts up just fine (but there is a warning):

Code:
WARNING: can not find configuration, assuming legacy method
Starting the virtual server alfa
Server alfa is not running
ipv4root is now 192.168.1.98
New security context is 49152
 * Caching service dependencies...
 * sysklogd -> start: syslogd...                                                     [ ok ]
 * sysklogd -> start: klogd...                                                       [ ok ]
 * Loading key mappings...                                                           [ ok ]
 * Initializing random number generator...                                           [ ok ]
 * Mounting network filesystems...                                                   [ ok ]
 * Starting vixie-cron...                                                            [ ok ]
 * Starting local...                                                                 [ ok ]


And vserver-stat returs the following:
Code:
CTX   PROC    VSZ    RSS  userTIME   sysTIME    UPTIME NAME
0       26  25.7M   2.6K   0m06s62   0m05s10   4m55s79 root server
49152    2   2.9M   334    0m00s00   0m00s00   0m18s57


But then when i want to enter the vserver using "vserver alfa enter", i get:
Code:
WARNING: can not find configuration, assuming legacy method
ipv4root is now 192.168.1.98
chcontext: vc_new_s_context(): Operation not permitted


What am i doing wrong ?
_________________
JID: kostko@transwarp.unimatrix-one.org
Back to top
View user's profile Send private message
Kostko
Tux's lil' helper
Tux's lil' helper


Joined: 07 Jul 2003
Posts: 83

PostPosted: Fri Dec 31, 2004 6:24 pm    Post subject: Reply with quote

Ok, i set it up... and after some patching it is now working on AMD64 :)
_________________
JID: kostko@transwarp.unimatrix-one.org
Back to top
View user's profile Send private message
halorgium
n00b
n00b


Joined: 06 Feb 2005
Posts: 1
Location: New Zealand

PostPosted: Sun Feb 06, 2005 12:51 pm    Post subject: Reply with quote

Hollow:

Perhaps edit the first posting to contain the new URI.

http://dev.gentoo.org/~hollow/vserver/guide/

Cheers,
halorgium
Back to top
View user's profile Send private message
lostSoul
Tux's lil' helper
Tux's lil' helper


Joined: 26 Oct 2002
Posts: 125
Location: /earth/germany/bielefeld

PostPosted: Mon Feb 07, 2005 5:05 pm    Post subject: Reply with quote

Nice work! 8)
Back to top
View user's profile Send private message
giant
Tux's lil' helper
Tux's lil' helper


Joined: 01 Aug 2002
Posts: 107

PostPosted: Mon Mar 14, 2005 11:02 am    Post subject: Reply with quote

First of all - thanks a lot for the guide :-)

I can start a vserver but I still have probs with the proc filesystem not being mounted :-(

this is the output - I changed the gentoo-template name to vgentoo.

Code:

loki root # vserver vgentoo start
 * Caching service dependencies...
klogctl: Operation not permitted                                                                                                                        [ ok ]
 * Starting syslog-ng...                                                                                                                                [ ok ]
 * Mounting network filesystems...                                                                                                                      [ ok ]
 * Starting vixie-cron...                                                                                                                               [ ok ]
 * Starting local...                                                                                                                                    [ ok ]
Error: /proc must be mounted
  To mount /proc at boot you need an /etc/fstab line like:
      /proc   /proc   proc    defaults
  In the meantime, mount /proc /proc -t proc


I changed the /etc/init.d/vserver to this:

Code:

#!/sbin/runscript
# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/sys-cluster/util-vserver/files/0.30.196/vservers.initd,v 1.2 2005/02/25 07:23:00 hollow Exp $

opts="${opts} vstatus"

checkconfig() {
        : ${UTIL_VSERVER_VARS:=/usr/lib/util-vserver/util-vserver-vars}
        [ -e $UTIL_VSERVER_VARS ] || {
                eerror "Cannot find util-vserver installation"
                eerror "(the file '$UTIL_VSERVER_VARS' would be expected)"
                exit 1
        }
        . $UTIL_VSERVER_VARS

        $_VPROCUNHIDE

        : ${MARK:=default}
        : ${LOCKFILE:=/var/lock/vservers-$MARK}
        : ${NUMPARALLEL:=6}
}

... and so on


but I still get the error.

I followed the guide to the letter.

Or have I overlooked something ?

This is the system

Code:

Linux loki 2.6.11-grsec-vs1.9.5-rc1 #1 Thu Mar 10 12:22:17 CET 2005 i686 AMD Athlon(tm) XP 1800+ AuthenticAMD GNU/Linux



Thanks for your help !
Back to top
View user's profile Send private message
giant
Tux's lil' helper
Tux's lil' helper


Joined: 01 Aug 2002
Posts: 107

PostPosted: Mon Mar 14, 2005 11:35 am    Post subject: Reply with quote

Hah :-)

Code:

/usr/lib/util-vserver/vprocunhide


looks like vprocunhide does not get executed.
Could it be that the location changed ? My bash script fu is not that good but don't I have to configure the path & location of vprocunhide ?

After executing vprocunhide everything works :)
Back to top
View user's profile Send private message
herka
n00b
n00b


Joined: 08 Aug 2003
Posts: 23

PostPosted: Thu Mar 17, 2005 10:53 pm    Post subject: Reply with quote

Hi there,
Thanks for your work.
Few remarks on your howto :
1) vproc
"emerge vproc" is not mentioned, but it seems useful
2 /etc/init.d/vserver start
it seems to be useful before "vserver xxx start" to correct to "Error: /proc must be mounted" error at startup, maybe "/etc/init.s/bootmgr start" too (do not forget "rc-update ..." if you want an automatic start a boot time)
3) iptables dependancy
in sys-cluster/util-vserver-0.30-204, iptables is requiered for a successful compilation, the ebuild need some adjustment ;-)
4) vserver stop starting
since sys-cluster/util-vserver-0.30-204 update, I was not able to start any vserver they stop after "* Caching service dependencies..."
I can provide "vserver --verbose --debug <xxx> start" output if it's meaningfull but I did not see any thing :-<
5) /etc/init.d/rebootmgr
I changed line 25: "$USR_SBIN/rebootmgr --pidfile $PIDFILE $VSERVERS &" by "/usr/lib/util-vserver/legacy/rebootmgr --pidfile $PIDFILE $VSERVERS &"

herka

EDITED: typo
Back to top
View user's profile Send private message
herka
n00b
n00b


Joined: 08 Aug 2003
Posts: 23

PostPosted: Wed Mar 30, 2005 3:35 pm    Post subject: Reply with quote

herka wrote:

4) vserver stop starting
since sys-cluster/util-vserver-0.30-204 update, I was not able to start any vserver they stop after "* Caching service dependencies..."
I can provide "vserver --verbose --debug <xxx> start" output if it's meaningfull but I did not see any thing :-<

Not finding any solution, I had to create new vservers.

And know the news ...(drum roll)...
I have got the "same" probleme after upgrading the kernel from vserver-sources-1.9.5_rc1-r1 to vserver-sources-1.9.5 doing emerge and reboot (cymbal)

What did I missed?

I hope any one can help me to not have to reinstall my vservers.
Herka
Back to top
View user's profile Send private message
bware
n00b
n00b


Joined: 23 Mar 2004
Posts: 22
Location: Amsterdam

PostPosted: Fri Apr 01, 2005 10:19 am    Post subject: Reply with quote

Simply run `rm -rf /vservers/SVRNAME/var/lib/init.d/started/*` will probably make it work again.

Adding this to the SVRNAME.sh to the pre-start section will save you from a lot of headaches in the future.
_________________
Regards,
BWare
Back to top
View user's profile Send private message
herka
n00b
n00b


Joined: 08 Aug 2003
Posts: 23

PostPosted: Wed Apr 06, 2005 11:19 pm    Post subject: Reply with quote

bware wrote:
Simply run `rm -rf /vservers/SVRNAME/var/lib/init.d/started/*` will probably make it work again.

I just figured that, any way thanks.

Quote:
Adding this to the SVRNAME.sh to the pre-start section will save you from a lot of headaches in the future.

This seems to be a very good tips, thanks for it. I'm going to put it in the /etc/vserver/SVRNAME/scripts/pre-start script that I already use in the following way
Code:
mount --bind -o ro /usr/portage /vservers/SVRNAME/usr/portage
. This allow me to have only one portage tree

BTW is there variable containing the vserver id created when a vserver is started, this would allow the use of generic script replacing SVRNAME by the variable.

herka
Back to top
View user's profile Send private message
eschoeller
n00b
n00b


Joined: 03 May 2004
Posts: 35

PostPosted: Fri Jun 03, 2005 4:28 am    Post subject: Tons of errors Reply with quote

Well i thought i followed this guide verbatim, but something is up:

I get this one:
klogctl: Operation not permitted
then i have issues with the filesystem:

* Checking root filesystem... [ ok ]
* Remounting root filesystem read/write...
* Root filesystem could not be mounted read/write :( [ !! ]

Give root password for maintenance
(or type Control-D for normal startup):

!!!!! :(
At first it was complaining that fsck.xfs was missing so i merged xfsprogs. I imagine there is something that needs to be changed in /etc/fstab??? I have the default one with /dev/BOOT etc... what should i change these to?

Thanks for the help!
Back to top
View user's profile Send private message
eschoeller
n00b
n00b


Joined: 03 May 2004
Posts: 35

PostPosted: Fri Jun 03, 2005 4:55 am    Post subject: Where to install baselayout-vserver? Reply with quote

Does baselayout-vserver get installed on the host or on the vserver? I have it installed on the vserver, (i had the original sys-apps/baselayout installed for some reason - the USE variable didnt merge sys-apps/baselayout-vserver for some reason). If anyone has any suggestions please let me know:
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo Chat All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum