LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   OpenVZ virtualization in Slackware (https://www.linuxquestions.org/questions/slackware-14/openvz-virtualization-in-slackware-528849/)

drkstr 02-13-2007 09:07 PM

OpenVZ virtualization in Slackware
 
Hello, I'm trying to get OpenVZ up and running on my Slackware box and all the instructions are for debian based distros. I was hoping I could get a few translations from any one who is multilingual.

First of all, I've been following these instructions to install. I have allready compiled the 2.6.18 kernel with the openvz patch and have my Slack box up and running with it.

Now the instructions say I need to send some parameters to the kernel to get everything to work right. It says to configure GRUB like so:
Code:

title Fedora Core (2.6.8-022stab029.1)
      root (hd0,0)
      kernel /vmlinuz-2.6.8-022stab029.1 ro root=/dev/sda5 quiet rhgb vga=0x31B
      initrd /initrd-2.6.8-022stab029.1.img

Is this just basicly telling me to add these kernel parameters (quiet rhgb vga=0x31B) to my lilo.conf? Anyone know the correct syntax off the top of their heads?

Next, it talks about configuring sysctl.
Code:

##/etc/sysctl.conf
##
# On Hardware Node we generally need
# packet forwarding enabled and proxy arp disabled
net.ipv4.ip_forward = 1
net.ipv4.conf.default.proxy_arp = 0
# Enables source route verification
net.ipv4.conf.all.rp_filter = 1
# Enables the magic-sysrq key
kernel.sysrq = 1
# TCP Explict Congestion Notification
#net.ipv4.tcp_ecn = 0
# we do not want all our interfaces to send redirects
net.ipv4.conf.default.send_redirects = 1
net.ipv4.conf.all.send_redirects = 0

I don't really know what sysctl is, but this kind of looks like /proc stuff. Will echoing these values into the <I forget the actual term, proc file system?> acomplish the same thing? If I did that, I would have to add the commands to the rc.local or somthing?

Other then those things, is there anything anyone would like to share that can make my life easier? I'm sure I could find these answers myself, but I'm not sure I know enough about all this to make sure I found the best answer. ;)

Thanks!
...aaron

H_TeXMeX_H 02-13-2007 09:21 PM

I wouldn't add that to grub.conf ... looks like those instructions are specific to Fedora Core. They require some translation ... I'll have to look into it a bit ... just a min.

H_TeXMeX_H 02-13-2007 09:30 PM

Ok, well this one should work (if you're using grub):

Code:

title OpenVZ (2.6.8-022stab029.1)
        root (hd0,0)
        kernel /vmlinuz-2.6.8-022stab029.1 ro root=/dev/sda5
        initrd /initrd-2.6.8-022stab029.1.img

now, remember only to add this entry, leave other entries in there alone in case it fails. Also, that "root (hd0,0)" might not be appropriate for your system. If you already have an entry in grub.conf for slack, copy that and modify it to look something like this.

as for

Quote:

There are a number of kernel parameters that should be set for OpenVZ to work correctly. These parameters are stored in /etc/sysctl.conf file. Here is the relevant part of the file; please edit it accordingly.

Code:

# On Hardware Node we generally need
# packet forwarding enabled and proxy arp disabled
net.ipv4.ip_forward = 1
net.ipv4.conf.default.proxy_arp = 0
# Enables source route verification
net.ipv4.conf.all.rp_filter = 1
# Enables the magic-sysrq key
kernel.sysrq = 1
# TCP Explict Congestion Notification
#net.ipv4.tcp_ecn = 0
# we do not want all our interfaces to send redirects
net.ipv4.conf.default.send_redirects = 1
net.ipv4.conf.all.send_redirects = 0


If there is a '/etc/sysctl.conf' then edit it as they say ... if not, then I suppose you may need to make one and put that stuff in there.

Other than that, not sure what to do with '/sbin/service vz start', you might have to run that after the kernel boots.

drkstr 02-15-2007 12:18 PM

Thanks for the help! Still haven't gotten it working yet, but I feel you got me on the right track now.

Quote:

Originally Posted by H_TeXMeX_H
Ok, well this one should work (if you're using grub):

Code:

title OpenVZ (2.6.8-022stab029.1)
        root (hd0,0)
        kernel /vmlinuz-2.6.8-022stab029.1 ro root=/dev/sda5
        initrd /initrd-2.6.8-022stab029.1.img

now, remember only to add this entry, leave other entries in there alone in case it fails. Also, that "root (hd0,0)" might not be appropriate for your system. If you already have an entry in grub.conf for slack, copy that and modify it to look something like this.

I am actually using lilo, but this grub menu listing looks a lot clearner so I think I get what I'm supposed to do now. Basicly I just need to boot up Linux with my custom kernel, which I am doing allready with lilo. So this part should be ok.


Quote:

Originally Posted by H_TeXMeX_H
If there is a '/etc/sysctl.conf' then edit it as they say ... if not, then I suppose you may need to make one and put that stuff in there.

I know I remembered seeing these settings being set a different way somewere, and it hit me when I read what the settings were a little closer.

Code:

#!/bin/sh
# /etc/rc.d/rc.ip_forward:  start/stop IP packet forwarding

# Start IP packet forwarding:
ip_forward_start() {
  if [ -f /proc/sys/net/ipv4/ip_forward ]; then
    echo "Activating IPv4 packet forwarding."
    echo 1 > /proc/sys/net/ipv4/ip_forward
  fi
}

# Stop IP packet forwarding:
ip_forward_stop() {
  if [ -f /proc/sys/net/ipv4/ip_forward ]; then
    echo "Disabling IPv4 packet forwarding."
    echo 0 > /proc/sys/net/ipv4/ip_forward
  fi
}

# Restart IP packet forwarding:
ip_forward_restart() {
  ip_forward_stop
  sleep 1
  ip_forward_start
}

case "$1" in
'start')
  ip_forward_start
  ;;
'stop')
  ip_forward_stop
  ;;
'restart')
  ip_forward_restart
  ;;
*)
  echo "usage $0 start|stop|restart"
esac

So I turned on this init script, and this too should now be ok (hopefully).

Quote:

Originally Posted by H_TeXMeX_H
Other than that, not sure what to do with '/sbin/service vz start', you might have to run that after the kernel boots.

This is just one of the OpenVZ binaries that I was able to compile from source.

Unfortunatly, there's a lot more to it then just telling it to "start", but now that I got this part figured out, I'm no longer at a mental road block.

I'll post back if I have any updates.

Thanks again,
...aaron

drkstr 02-18-2007 12:20 PM

Well I at least have it sorta working now. One of the problems I was having was a missing init script that is only included when you download the precompiled binaries. I was able to get the VE running after moving the init script to /etc/rc.d/rc.openvz, and creating a Slackware template from reading this guide (in addition to the packages they say to install, I also had to install l/libtermcap and l/glibc. I could have just been doing somthing wrong however).

Now my problem is running software in the VE (sshd in particular), but the is more an issue of configuring the Slackware template with the correct kernel settings and libs.

Any ways, thanks again for thr help!
...aaron


All times are GMT -5. The time now is 10:12 PM.