Leaderboard (728 x 90)
Showing posts with label Virtuozzo. Show all posts
Showing posts with label Virtuozzo. Show all posts

Tuesday, September 21, 2010

How to uninstall Parallels Virtuozzo for Linux

1. stop Virtuozzo services
service vz stop

2. uninstall all Virtuozzo packages
rpm -qa|grep swsoft|grep vz|xargs yum remove -y
rpm -qa|grep swsoft|grep -E "virtu|-ez-|-tmpl-"|xargs yum remove -y

3. remove /vz contents (directories: actionlog, backups, lock, private, root, template, vzup2date)
cd /vz/ && mkdir _before_reinstall && mv * _before_reinstall

4. remove configs from /etc
mkdir -p /vz/_before_reinstall/etc && find /etc -name vz\* -exec mv {} /vz/_before_reinstall/etc \;

5. check /etc/grub.conf if it has a proper configuration (no Virtuozzo kernel, Red Hat kernel is default)

6. check /etc/sysctl.conf for tuned parameters which you might not need

7. reboot the server

Reference: http://forum.parallels.com/showthread.php?t=72613 by Alec@sw

Thursday, May 6, 2010

How do I mount an ISO image in Virtuozzo container?

In Parallels Virtuozzo Containers 4.0 you may use FUSE (filesystem in userspace) to mount ISO image inside a container.

1. Make sure that 'fuse' module is loaded on hardware node:

~# lsmod | grep fuse

If it is not there, use:

~# modprobe fuse
~# lsmod|grep fuse
fuse 45320 0

In case you would like to load 'fuse' module automatically before starting the service 'vz' please implement init script '/etc/rc.modules' on your node, as described in the article:

---8<--- http://kb.parallels.com/en/696
...
In order to automate modules loading before Virtuozzo services are started you may install 'openvpn' package from Virtuozzo distrib (in HW/RPMS directory) and enable it in default runlevel (use 'chkconfig' utility to do that). Please also use instructions on automated module loading suitable for base OS installed on hardware node.
Just for example, for RedHat-based systems (such as Fedora Core, RedHat AS3/AS4, CentOS 3/4) it should be enough to add 'modprobe tun' command into /etc/rc.modules file and make it executable:

# chmod a+rx /etc/rc.modules
--->8---


and then put the command 'modprobe fuse' inside the file.

After that please restart the hardware node to make sure that 'fuse' module is loaded correctly before the service 'vz'.

2. Grant a container #101 the permission to work with /dev/fuse character device and create corresponding device inside a container (run these commands on Virtuozzo server):

~# vzctl set 101 --devices c:10:229:rw --save
~# vzctl exec 101 mknod -m 666 /dev/fuse c 10 229
~# vzctl exec 101 cp -a /dev/fuse /lib/udev/devices/


In case the file /dev/fuse already exist please make sure it has proper access permissions. Also if the directory '/lib/udev/devices' does not exist, please create it and set correct access permissions:

# vzctl exec 101 mkdir /lib/udev/devices
# vzctl exec 101 chmod 755 /lib/udev/devices/



Check these files:

~# vzctl exec 101 ls -l /lib/udev/devices/fuse
crw-rw-rw- 1 root root 10, 229 Oct 25 19:37 /lib/udev/devices/fuse

# vzctl exec 101 ls -l /dev/fuse
crw-rw-rw- 1 root root 10, 229 Oct 25 19:37 /dev/fuse


3. Install packages fuseiso and fuse into container. Names of packages may be different on different Linux distributions: for Debian and Ubuntu install fuseiso and fuse-utils packages (available in repository) for RHEL/CentOS 3/4/5 use DAG's packages fuse-iso and fuse for Fedora 7/8 both fuseiso and fuse are available from the main/updates repositories for Fedora 6, fuse is available from extras repo, use dries for fuse-iso To mount an ISO image run the command inside a container:

~# fuseiso IMAGE.iso /mnt

Replace IMAGE.iso in the command above with the exact name of ISO image (including path) on filesystem, replace /mnt with path where you want ISO image to be mounted.

To umount image use this command:

~# fusermount -u /mnt

Again - replace /mnt with exact path where ISO image was mounted.

Reference: http://kb.parallels.com/en/4628

How to allow container to use device on hardware node in Virtuozzo Container?

Make sure the device has been already loaded on the hardware node using lsmod. If doesn't load, using modprobe command to load it.

Example:
# lsmod | grep tun
If it is not there, use
# modprobe tun


run the command on hardware node
vzctl set 101 --devices c:10:200:rw --save

where

101 means container ID 101 will be granted permissions to use the device
c:10:200:rw means allow read/write permissions over character device with major number 10 and minor number 200

Then run the command
vzctl exec 101 mknod /dev/net/tun c 10 200

where /dev/net/tun
is device file for character device with major number 10 and minor number 200

Check for major number and minor number of the device for devices.txt in kernel documentation.

Saturday, April 24, 2010

some iptables functions don't work after install virtuozzo

Symptom:
some iptables function that relate with connection tracking module aren't functional after you install virtuozzo.
Example: -m state --state ESTABLISHED,RELATED

Cause:
kernel module named ip_conntrack is disabled by default on hardware node or container 0 (ve0).

Resolution:
Enable ip_conntrack for ve0 by add following line to /etc/modprobe.conf file.

options ip_conntrack ip_conntrack_enable_ve0=1

and if you see these following line in the file

options ip_conntrack ip_conntrack_disable_ve0=1

then change the parameter to 0 as following.

options ip_conntrack ip_conntrack_disable_ve0=0