<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.openvz.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Robert+Brockway</id>
	<title>OpenVZ Virtuozzo Containers Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.openvz.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Robert+Brockway"/>
	<link rel="alternate" type="text/html" href="https://wiki.openvz.org/Special:Contributions/Robert_Brockway"/>
	<updated>2026-05-02T19:17:52Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.31.1</generator>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Vzctl_for_upstream_kernel&amp;diff=13833</id>
		<title>Vzctl for upstream kernel</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Vzctl_for_upstream_kernel&amp;diff=13833"/>
		<updated>2013-06-10T01:40:10Z</updated>

		<summary type="html">&lt;p&gt;Robert Brockway: I understand they can be stopped too :)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''This article describes using OpenVZ tool vzctl as an alternative to LXC tools.'''&lt;br /&gt;
&lt;br /&gt;
Recent vzctl releases (starting from version 4.0) can be used with upstream (non-OpenVZ) Linux kernels (that essentially means any recent 3.x kernel). At the moment, it provides just basic functionality.&lt;br /&gt;
It is currently possible to create, start and stop a container with the same steps as one would use for a normal OpenVZ container. Other features may be present with limited functionality, while some are not present at all. We appreciate all bug reports, please file to [http://bugzilla.openvz.org/enter_bug.cgi?component=vzctl bugzilla].&lt;br /&gt;
&lt;br /&gt;
Running vzctl on upstream kernels is considered an experimental feature. See [[#Limitations]] below.&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
{{Note|This section describes installation for RPM-based distros. See [[#Building]] below if you want to compile vzctl from source.}}&lt;br /&gt;
&lt;br /&gt;
First, set up OpenVZ yum repository. Download [[download:openvz.repo|openvz.repo]] file and put it to your &amp;lt;code&amp;gt;/etc/yum.repos.d/&amp;lt;/code&amp;gt; repository,&lt;br /&gt;
and import OpenVZ GPG key used for signing RPM packages. This can be achieved by the following commands, as root:&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
wget -P /etc/yum.repos.d/ http://download.openvz.org/openvz.repo&lt;br /&gt;
rpm --import http://download.openvz.org/RPM-GPG-Key-OpenVZ&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
In case you can not cd to /etc/yum.repos.d, it means either yum is not installed on your system, or yum version is too old.&lt;br /&gt;
&lt;br /&gt;
Then, install vzctl-core package:&lt;br /&gt;
&lt;br /&gt;
 yum install vzctl-core&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
For supported features, usage is expected to be the same as standard vzctl tool. See {{man|vzctl|8}} for more information.&lt;br /&gt;
&lt;br /&gt;
=== Networking ===&lt;br /&gt;
{{Note|IP mode networking (--ipadd / --ipdel) is currently not supported}}&lt;br /&gt;
&lt;br /&gt;
Networking is available through the switches &amp;lt;code&amp;gt;--netdev_add&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;--netif_add&amp;lt;/code&amp;gt;, and their respective deletion counterparts.&lt;br /&gt;
Unfortunately now it requires some manual configuration.&lt;br /&gt;
&lt;br /&gt;
== Bridged networking ==&lt;br /&gt;
&lt;br /&gt;
The following example assumes&lt;br /&gt;
* you already have a bridge configured on the host system&lt;br /&gt;
* bridge interface name is virbr0&lt;br /&gt;
* CT is running Red Hat like distro (CentOS)&lt;br /&gt;
&lt;br /&gt;
 vzctl set $CTID --netif_add eth0,,,,virbr0 --save&lt;br /&gt;
&lt;br /&gt;
 echo &amp;quot;NETWORKING=yes&amp;quot; &amp;gt; /vz/private/$CTID/etc/sysconfig/network&lt;br /&gt;
&lt;br /&gt;
 cat &amp;lt;&amp;lt; EOF &amp;gt; /vz/private/$CTID/etc/sysconfig/network-scripts/ifcfg-eth0&lt;br /&gt;
 DEVICE=eth0&lt;br /&gt;
 BOOTPROTO=dhcp&lt;br /&gt;
 ONBOOT=yes&lt;br /&gt;
 EOF&lt;br /&gt;
&lt;br /&gt;
 vzctl start $CTID&lt;br /&gt;
&lt;br /&gt;
After this, you can find CT IP using this:&lt;br /&gt;
 # ip netns exec $CTID ip address list&lt;br /&gt;
&lt;br /&gt;
== Limitations ==&lt;br /&gt;
&lt;br /&gt;
{{Note|We recommend using [[Download/kernel/rhel6|OpenVZ kernel]] for features, stability and security}}&lt;br /&gt;
&lt;br /&gt;
The following vzctl commands are not working at all with the non-OpenVZ kernel:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;quotaon&amp;lt;/code&amp;gt;/&amp;lt;code&amp;gt;quotaoff&amp;lt;/code&amp;gt;/&amp;lt;code&amp;gt;quotainit&amp;lt;/code&amp;gt; (vzquota-specific)&lt;br /&gt;
* &amp;lt;code&amp;gt;convert&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;compact&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;snapshot*&amp;lt;/code&amp;gt; (ploop-specific)&lt;br /&gt;
* &amp;lt;code&amp;gt;console&amp;lt;/code&amp;gt; (needs a virtual /dev/console, /dev/ttyN device)&lt;br /&gt;
* &amp;lt;code&amp;gt;chkpnt&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;restore&amp;lt;/code&amp;gt; (currently need OpenVZ-kernel-specific checkpointing, [http://criu.org/ CRIU] will be supported later)&lt;br /&gt;
&lt;br /&gt;
The following binaries are not ported to work on top of upstream kernel:&lt;br /&gt;
* vzlist&lt;br /&gt;
* vzcalc&lt;br /&gt;
* vzcfgvalidate&lt;br /&gt;
* vzcpucheck&lt;br /&gt;
* vzmemcheck&lt;br /&gt;
* vzmigrate&lt;br /&gt;
* vzeventd&lt;br /&gt;
* vzpid&lt;br /&gt;
* vzsplit&lt;br /&gt;
* vzubc&lt;br /&gt;
&lt;br /&gt;
=== /proc and /sys ===&lt;br /&gt;
Software that depend on information supplied by the proc filesystem may not work correctly, since there is not a full solution for full /proc virtualization. For instance, /proc/stat is not yet virtualized, and top will show distorted values.&lt;br /&gt;
&lt;br /&gt;
=== Resource management ===&lt;br /&gt;
&lt;br /&gt;
With non-OpenVZ kernel, setting resources like &amp;lt;code&amp;gt;--ram&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;--cpuunits&amp;lt;/code&amp;gt; works, but there their effect is dependent on what the current kernel supports, through the cgroups subsystem. When a particular cgroup file is present, it will be used. Currently, vzctl will search for the following files:&lt;br /&gt;
* cpu.cfs_quota_us&lt;br /&gt;
* cpu.shares&lt;br /&gt;
* cpuset.cpus&lt;br /&gt;
* memory.limit_in_bytes&lt;br /&gt;
* memory.memsw.limit_in_bytes&lt;br /&gt;
* memory.kmem.limit_in_bytes&lt;br /&gt;
* memory.kmem.tcp.limit_in_bytes&lt;br /&gt;
&lt;br /&gt;
== Building ==&lt;br /&gt;
&lt;br /&gt;
In case you don't want to use packages provided by OpenVZ (available from [[Download/vzctl]]), but rather would like to compile vzctl from sources, read on.&lt;br /&gt;
&lt;br /&gt;
=== Dependencies ===&lt;br /&gt;
&lt;br /&gt;
The following software needs to be installed on your system:&lt;br /&gt;
&lt;br /&gt;
* iproute2 &amp;gt;= 3.0.0 (runtime only)&lt;br /&gt;
* libcgroup &amp;gt;= 0.38&lt;br /&gt;
&lt;br /&gt;
=== Download ===&lt;br /&gt;
&lt;br /&gt;
You can get the latest released version from [[Download/vzctl/{{Latest vzctl}}#sources]] or directly from [[download:utils/vzctl/current/src/]].&lt;br /&gt;
&lt;br /&gt;
If you are living on the bleeding edge, get vzctl sources from git. Then run autogen.sh to recreate auto* files:&lt;br /&gt;
&lt;br /&gt;
 git clone &amp;lt;nowiki&amp;gt;git://git.openvz.org/pub/vzctl&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 cd vzctl&lt;br /&gt;
 ./autogen.sh&lt;br /&gt;
&lt;br /&gt;
=== Compile ===&lt;br /&gt;
&lt;br /&gt;
Usual &amp;lt;code&amp;gt;./configure &amp;amp;&amp;amp; make&amp;lt;/code&amp;gt; should do. But you probably want to specify more options. It makes sense to:&lt;br /&gt;
&lt;br /&gt;
* enable cgroup support&lt;br /&gt;
* add &amp;lt;code&amp;gt;--without-ploop&amp;lt;/code&amp;gt; (unless you want [[ploop]] compiled it) because otherwise you will need ploop lib headers (available from [[Download/ploop]]).&lt;br /&gt;
* enable bash completion support&lt;br /&gt;
* set prefix to /usr&lt;br /&gt;
&lt;br /&gt;
See &amp;lt;code&amp;gt;./configure --help&amp;lt;/code&amp;gt; output for more details and options available.&lt;br /&gt;
&lt;br /&gt;
So, the command will look like:&lt;br /&gt;
&lt;br /&gt;
 $ ./configure --with-cgroup --without-ploop --enable-bashcomp --prefix=/usr &lt;br /&gt;
 $ make -j4&lt;br /&gt;
&lt;br /&gt;
=== Install ===&lt;br /&gt;
&lt;br /&gt;
 # make install&lt;/div&gt;</summary>
		<author><name>Robert Brockway</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=NFS&amp;diff=9467</id>
		<title>NFS</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=NFS&amp;diff=9467"/>
		<updated>2010-11-29T20:52:25Z</updated>

		<summary type="html">&lt;p&gt;Robert Brockway: /* ISSUE: can't install nfs-common on ubuntu VE */ Fix typo and additional information for CentOS 5&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page describes how to mount NFS partition inside a container.&lt;br /&gt;
&lt;br /&gt;
== NFS server ==&lt;br /&gt;
Currently OpenVZ kernel doesn't include kernel NFS server support. However you are still able to use user space [[NFS server inside container]].&lt;br /&gt;
If your OpenVZ-patched kernel has NFS kernel support compiled in (this is the case with Debian's 2.6.26 kernel, for example), you can export filesystems on the HN by usual means, just keep in mind that exporting a container's `root` will most probably not work (it can hang at mount attempt and produce symptoms as described below) - export `private` instead.&lt;br /&gt;
&lt;br /&gt;
== NFS client ==&lt;br /&gt;
=== Preparations ===&lt;br /&gt;
==== Prerequisites ====&lt;br /&gt;
You will need the following software:&lt;br /&gt;
&lt;br /&gt;
# vzctl version 3.0.13 or higher (do &amp;lt;code&amp;gt;vzctl --version&amp;lt;/code&amp;gt;)&lt;br /&gt;
# kernel version 2.6.18-028test006 or higher (2.6.18-028stab* will do), or any recent RHEL5-based or 2.6.20-based kernel.&lt;br /&gt;
&lt;br /&gt;
Note: In all the kernels earlier than 028stab038, kernel NFS support can be given to a container by setting:&lt;br /&gt;
&lt;br /&gt;
      sunrpc.ve_allow_rpc = 1&lt;br /&gt;
      fs.nfs.ve_allow_nfs = 1&lt;br /&gt;
      kernel.ve_allow_kthreads = 1&lt;br /&gt;
&lt;br /&gt;
This can be done by adding the above lines into /etc/sysctl.conf on the hardware node, and then running &amp;lt;code&amp;gt;sysctl -p&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===== Debian Notes =====&lt;br /&gt;
&lt;br /&gt;
Debian Etch still uses vzctl version 3.0.11 and so NFS client support is not yet available. Lenny presently has version 3.0.18.&lt;br /&gt;
&lt;br /&gt;
==== Prepare the HN ====&lt;br /&gt;
&lt;br /&gt;
For NFS mounts to work in the containers with the RHEL5-based kernels you must enable kernel threads in the container by setting &amp;lt;code&amp;gt;kernel.ve_allow_kthreads=1&amp;lt;/code&amp;gt; in &amp;lt;code&amp;gt;/etc/sysctl.conf&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
 # modprobe nfs&lt;br /&gt;
&lt;br /&gt;
You will probably want the nfs module to load automatically on reboots.  One way to do this is to put the modprobe  command in your /etc/rc.d/rc.local file:&lt;br /&gt;
&lt;br /&gt;
  modprobe nfs&lt;br /&gt;
&lt;br /&gt;
==== Prepare the container ====&lt;br /&gt;
To allow a container to use NFS filesystem, you will need to start it with &amp;quot;nfs&amp;quot; feature enabled. If the container is running while you set the &amp;lt;code&amp;gt;--features nfs:on&amp;lt;/code&amp;gt;, you will need to reboot it.&lt;br /&gt;
&lt;br /&gt;
 # vzctl set 101 --features &amp;quot;nfs:on&amp;quot; --save&lt;br /&gt;
 # vzctl start 101&lt;br /&gt;
&lt;br /&gt;
After this you may see nfs in &amp;lt;code&amp;gt;/proc/filesystems&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# vzctl exec 101 cat /proc/filesystems&lt;br /&gt;
        ext3&lt;br /&gt;
        ext2&lt;br /&gt;
nodev   rpc_pipefs&lt;br /&gt;
nodev   proc&lt;br /&gt;
nodev   nfs&lt;br /&gt;
nodev   sysfs&lt;br /&gt;
nodev   tmpfs&lt;br /&gt;
nodev   devpts&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Mounting NFS ===&lt;br /&gt;
Make sure that packages &amp;lt;code&amp;gt;nfs-utils&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;nfs-utils-lib&amp;lt;/code&amp;gt; or similar are installed in a container.&lt;br /&gt;
&lt;br /&gt;
Assuming that you already have NFS server set up at &amp;lt;code&amp;gt;192.168.0.1:/nfs_pub&amp;lt;/code&amp;gt;, mounting will be simple&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# vzctl enter 100&lt;br /&gt;
# mkdir /nfs&lt;br /&gt;
# mount -t nfs 192.168.0.1:/nfs_pub /nfs&lt;br /&gt;
# cat /proc/mounts &lt;br /&gt;
simfs / simfs rw 0 0&lt;br /&gt;
proc /proc proc rw 0 0&lt;br /&gt;
sysfs /sys sysfs rw 0 0&lt;br /&gt;
devpts /dev/pts devpts rw 0 0&lt;br /&gt;
nfs /nfs nfs rw,vers=3,rsize=32768,wsize=32768,hard,proto=tcp,timeo=600,retrans=2,sec=sys,addr=192.168.0.1 0 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For more details on how to setup NFS mount, see [http://nfs.sourceforge.net/nfs-howto/ar01s04.html NFS-client HOWTO]&lt;br /&gt;
&lt;br /&gt;
=== Known issues ===&lt;br /&gt;
* There are quite a few parameters in NFS, so sometimes it doesn't work due to misconfiguration. We've created a separate&lt;br /&gt;
page describing such situations: [[NFS doesn't work]].&lt;br /&gt;
* Suspend and migrate operations fail if the VE has NFS partitions mounted [http://bugzilla.openvz.org/show_bug.cgi?id=616]&lt;br /&gt;
&lt;br /&gt;
== ISSUE: can't install nfs-common on ubuntu VE ==&lt;br /&gt;
&lt;br /&gt;
Host machine is ubuntu server 8.0.4 , VE container is ubuntu from openvz template repo.&lt;br /&gt;
&lt;br /&gt;
Despite following all of the above directives, I am unable to get nfs-common to install on the VE (installs fine on the host machine).&lt;br /&gt;
&lt;br /&gt;
Here is output ''(from inside VE)'' when I try to install nfs-common&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
root@clinton:/# apt-get install nfs-common&lt;br /&gt;
Reading package lists... Done&lt;br /&gt;
Building dependency tree       &lt;br /&gt;
Reading state information... Done&lt;br /&gt;
nfs-common is already the newest version.&lt;br /&gt;
0 upgraded, 0 newly installed, 0 to remove and 4 not upgraded.&lt;br /&gt;
1 not fully installed or removed.&lt;br /&gt;
After this operation, 0B of additional disk space will be used.&lt;br /&gt;
Setting up nfs-common (1:1.1.2-2ubuntu2.2) ...&lt;br /&gt;
 * Starting NFS common utilities                                                                                                                         [fail] &lt;br /&gt;
invoke-rc.d: initscript nfs-common, action &amp;quot;start&amp;quot; failed.&lt;br /&gt;
dpkg: error processing nfs-common (--configure):&lt;br /&gt;
 subprocess post-installation script returned error exit status 1&lt;br /&gt;
Errors were encountered while processing:&lt;br /&gt;
 nfs-common&lt;br /&gt;
E: Sub-process /usr/bin/dpkg returned an error code (1)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The cause of this problem is that portmap is not running. Portmap must be running before installing nfs-common.  On CentOS 5 (and possible other versions) both the netfs and portmap startup scripts need to be running.&lt;br /&gt;
&lt;br /&gt;
Just run portmap:&lt;br /&gt;
&lt;br /&gt;
 # /etc/init.d/portmap start&lt;br /&gt;
&lt;br /&gt;
Then, install nfs-common:&lt;br /&gt;
&lt;br /&gt;
 # apt-get install nfs-common&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [http://nfs.sourceforge.net/nfs-howto/ar01s04.html NFS-client HOWTO]&lt;br /&gt;
[[Category: HOWTO]]&lt;/div&gt;</summary>
		<author><name>Robert Brockway</name></author>
		
	</entry>
</feed>