特殊:Badtitle/NS100:VServer:修订间差异
小无编辑摘要 |
小无编辑摘要 |
||
(未显示同一用户的6个中间版本) | |||
第1行: | 第1行: | ||
{{From|https://help.ubuntu.com/community/VServer}} | {{From|https://help.ubuntu.com/community/VServer}} | ||
{{Languages|UbuntuHelp:VServer}} | {{Languages|UbuntuHelp:VServer}} | ||
<<Include(Tag/Unsupported)>> | |||
=== What are VServers === | === What are VServers === | ||
The [http://linux-vserver.org Linux VServer Project] provides multiple Linux environments running inside a single Linux kernel. | The [http://linux-vserver.org Linux VServer Project] provides multiple Linux environments running inside a single Linux kernel. | ||
You can think of it as a bit like running a new system inside a ''chroot'', but with a different host name and IP address, a de-fanged `root` user, and configurable resource management. This is a similar feature to ''jails'' on FreeBSD and ''containers'' on Solaris 10+. | You can think of it as a bit like running a new system inside a ''chroot'', but with a different host name and IP address, a de-fanged `root` user, and configurable resource management. This is a similar feature to ''jails'' on FreeBSD and ''containers'' on Solaris 10+. | ||
VServers are a different approach to the popular | VServers are a different approach to the popular | ||
[http://www.xensource.com XEN] Hypervisor; with XEN you end up with a kernel for each virtual server; VServers do not. So, with VServer you have less (virtually no) overhead, on the other hand you also have fewer features - it is currently impossible to have a VServer with a different time set to the host system, for instance. However it ''is'' possible to run a different time zone, as that is a purely ''user-space'' feature. The design of UNIX in general mean that for the vast majority of applications, this virtualisation technique is perfectly adequate. | [http://www.xensource.com XEN] Hypervisor; with XEN you end up with a kernel for each virtual server; VServers do not. So, with VServer you have less (virtually no) overhead, on the other hand you also have fewer features - it is currently impossible to have a VServer with a different time set to the host system, for instance. However it ''is'' possible to run a different time zone, as that is a purely ''user-space'' feature. The design of UNIX in general mean that for the vast majority of applications, this virtualisation technique is perfectly adequate. | ||
Note that Xen and VServer are ''orthogonal'' approaches - that is, it is perfectly possible and sometimes even sensible to run Xen virtual machines on a Linux system, then Linux VServers within those Xen machines. | Note that Xen and VServer are ''orthogonal'' approaches - that is, it is perfectly possible and sometimes even sensible to run Xen virtual machines on a Linux system, then Linux VServers within those Xen machines. | ||
=== Karmic, Jaunty, Intrepid and Hardy === | |||
For Karmic, Jaunty, Intrepid and Hardy there are binary kernel images available. Please take a look at [http://linux-vserver.org/Installation_on_Ubuntu Installation on Ubuntu] at the Linux VServer [http://linux-vserver.org wiki]. | |||
=== Installation (u32) === | === Installation (u32) === | ||
This describes how to install the VServer-enabled kernel packages built on top of Edgy's stock kernel (source is in http://git.u32.net/). If you want to verify the packages, you can add the package key to apt's keyring (this is optional). As of now packages are only available for x86 and amd64, hopefully more architectures will be supported soon. | This describes how to install the VServer-enabled kernel packages built on top of Edgy's stock kernel (source is in http://git.u32.net/). If you want to verify the packages, you can add the package key to apt's keyring (this is optional). As of now packages are only available for x86 and amd64, hopefully more architectures will be supported soon. | ||
No kernel pre-built for feisty currently exists for Ubuntu. You'll have to use the Edgy 2.6.17 for now. Also, be careful to install the VServer tools using the Edgy repository, or versions won't match and you'll get segmentation faults. | No kernel pre-built for feisty currently exists for Ubuntu. You'll have to use the Edgy 2.6.17 for now. Also, be careful to install the VServer tools using the Edgy repository, or versions won't match and you'll get segmentation faults. | ||
<pre><nowiki> | <pre><nowiki> | ||
$ wget -O - http://bronson.rinspin.com/u32-package-key.gpg | sudo apt-key add - | $ wget -O - http://bronson.rinspin.com/u32-package-key.gpg | sudo apt-key add - | ||
</nowiki></pre> | </nowiki></pre> | ||
Now add the following repositories to your /etc/apt/sources.list. Read [[UbuntuHelp:Repositories/Ubuntu| this page]] for instructions on how to add repositories. | Now add the following repositories to your /etc/apt/sources.list. Read [[UbuntuHelp:Repositories/Ubuntu| this page]] for instructions on how to add repositories. | ||
<pre><nowiki> | |||
<pre><nowiki>deb http://dpkg.u32.net/ubuntu edgy vserver | deb http://dpkg.u32.net/ubuntu edgy vserver | ||
deb-src http://dpkg.u32.net/ubuntu edgy vserver</nowiki></pre> | deb-src http://dpkg.u32.net/ubuntu edgy vserver</nowiki></pre> | ||
Now, install the software packages and the kernel. Instead of vserver-generic, you can also supply any Ubuntu-supported flavor (vserver-i386, vserver-server, etc). Run 'cat /proc/version' to see what flavor kernel you're running now. | Now, install the software packages and the kernel. Instead of vserver-generic, you can also supply any Ubuntu-supported flavor (vserver-i386, vserver-server, etc). Run 'cat /proc/version' to see what flavor kernel you're running now. | ||
<pre><nowiki> | |||
<pre><nowiki>$ sudo apt-get install util-vserver vserver-debiantools | $ sudo apt-get install util-vserver vserver-debiantools | ||
$ sudo apt-get install linux-vserver-image-2.6.17-11-vserver-generic</nowiki></pre> | $ sudo apt-get install linux-vserver-image-2.6.17-11-vserver-generic</nowiki></pre> | ||
And reboot into your new, VServer-enabled kernel. | And reboot into your new, VServer-enabled kernel. | ||
This 2.6.17 Edgy kernel runs just fine on Dapper as well. Occasionally dpkg may stop claiming "error in postinst." This is just a bad interaction between older and newer kernel tools and, other than preventing the install from completing, it's harmless. Just purge and reinstall and it should work. | This 2.6.17 Edgy kernel runs just fine on Dapper as well. Occasionally dpkg may stop claiming "error in postinst." This is just a bad interaction between older and newer kernel tools and, other than preventing the install from completing, it's harmless. Just purge and reinstall and it should work. | ||
You may want to run run ln -sf /vservers /etc/vservers/.defaults/vdirbase to specify where your vservers should reside (this puts them in /vservers). By default they are stored in /var/lib/vservers. | You may want to run run ln -sf /vservers /etc/vservers/.defaults/vdirbase to specify where your vservers should reside (this puts them in /vservers). By default they are stored in /var/lib/vservers. | ||
The git tree for the patched kernel can be downloaded from http://git.u32.net. | The git tree for the patched kernel can be downloaded from http://git.u32.net. | ||
==== Create a new guest ==== | ==== Create a new guest ==== | ||
/etc/vservers/newvserver-vars (man newvserver(1) for options): | /etc/vservers/newvserver-vars (man newvserver(1) for options): | ||
DIST='dapper' | DIST='dapper' | ||
MIRROR="http://us.archive.ubuntu.com/ubuntu" | MIRROR="http://us.archive.ubuntu.com/ubuntu" | ||
This command creates a new Ubuntu Dapper image. You can change "dapper" to "edgy" or whatever you want above. You can run virtually any Linux distribution as a guest (for instance, [http://www.gentoo.org/proj/en/vps/vserver-howto.xml Gentoo]). | This command creates a new Ubuntu Dapper image. You can change "dapper" to "edgy" or whatever you want above. You can run virtually any Linux distribution as a guest (for instance, [http://www.gentoo.org/proj/en/vps/vserver-howto.xml Gentoo]). | ||
newvserver -v --hostname NAME --domain EXAMPLE.COM --interface ETHX --ip IPADDRESS | newvserver -v --hostname NAME --domain EXAMPLE.COM --interface ETHX --ip IPADDRESS | ||
See [http://wiki.u32.net/index.php?title=Linux-VServer this page] for some tweaks to make your Dapper guest a little more vserver-friendly. Run 'vserver NAME start' to start your new guest image, then 'vserver NAME enter' to use it. | See [http://wiki.u32.net/index.php?title=Linux-VServer this page] for some tweaks to make your Dapper guest a little more vserver-friendly. Run 'vserver NAME start' to start your new guest image, then 'vserver NAME enter' to use it. | ||
=== Installation (Uniklu) === | === Installation (Uniklu) === | ||
Installation is quite simple - you need: | Installation is quite simple - you need: | ||
* Kernel with VServer patch | * Kernel with VServer patch | ||
* util-vserver | * util-vserver | ||
* vserver-debiantools | * vserver-debiantools | ||
You can install these packages if you add the following lines to your sources.list: | You can install these packages if you add the following lines to your sources.list: | ||
* dapper <pre><nowiki> | |||
* dapper | |||
<pre><nowiki> | |||
deb http://ubuntu.uni-klu.ac.at/ubuntu.uniklu/ dapper uniklu-vserver | deb http://ubuntu.uni-klu.ac.at/ubuntu.uniklu/ dapper uniklu-vserver | ||
#deb-src http://ubuntu.uni-klu.ac.at/ubuntu.uniklu/ dapper uniklu-vserver | #deb-src http://ubuntu.uni-klu.ac.at/ubuntu.uniklu/ dapper uniklu-vserver | ||
</nowiki></pre> | </nowiki></pre> | ||
* edgy (not needed, already in universe) | * edgy (not needed, already in universe) | ||
The uniklu archives are signed - if you want get rid of apt-get warnings: | The uniklu archives are signed - if you want get rid of apt-get warnings: | ||
<pre><nowiki> | <pre><nowiki> | ||
$ wget -nv http://ubuntu.uni-klu.ac.at/uniklu-debuild.pub -O - | sudo apt-key add - | $ wget -nv http://ubuntu.uni-klu.ac.at/uniklu-debuild.pub -O - | sudo apt-key add - | ||
</nowiki></pre> | </nowiki></pre> | ||
To install the VServer Kernel and utils enter: | To install the VServer Kernel and utils enter: | ||
* dapper | * dapper <pre><nowiki> | ||
<pre><nowiki> | |||
# apt-get install linux-image-2.6.15-(dapper_abi+1)-686 | # apt-get install linux-image-2.6.15-(dapper_abi+1)-686 | ||
# apt-get install util-vserver vserver-debiantools</nowiki></pre> | # apt-get install util-vserver vserver-debiantools</nowiki></pre> | ||
* edgy | * edgy <pre><nowiki> | ||
<pre><nowiki> | |||
# apt-get install kernel-patch-vserver | # apt-get install kernel-patch-vserver | ||
# apt-get install util-vserver</nowiki></pre> | # apt-get install util-vserver</nowiki></pre> | ||
You should get the following revisions | You should get the following revisions | ||
* dapper | * dapper | ||
第104行: | 第74行: | ||
| vserver-debiantools || 0.2.6 | | vserver-debiantools || 0.2.6 | ||
|} | |} | ||
At the moment the kernel is one revision behind the offical Ubuntu Kernel - will be fixed soon ! | At the moment the kernel is one revision behind the offical Ubuntu Kernel - will be fixed soon ! | ||
Make sure you install the kernel from the uniklu-vserver archive. | Make sure you install the kernel from the uniklu-vserver archive. | ||
第114行: | 第83行: | ||
Pin-Priority: 1001 | Pin-Priority: 1001 | ||
</nowiki></pre> | </nowiki></pre> | ||
The vserver-debiantools do not work 100% but should help you | The vserver-debiantools do not work 100% but should help you | ||
setting your first vserver quickly - see [http://support.uni-klu.ac.at/VServer Uniklu VServer Info] | setting your first vserver quickly - see [http://support.uni-klu.ac.at/VServer Uniklu VServer Info] | ||
The Kernel is the standard Ubuntu Kernel with the Vserver patch applied. | The Kernel is the standard Ubuntu Kernel with the Vserver patch applied. | ||
* dapper: Vserver patch >= 2.0.2-rc13 for kernel-2.6.15 | * dapper: Vserver patch >= 2.0.2-rc13 for kernel-2.6.15 | ||
* edgy: patch from universe should be up2date | * edgy: patch from universe should be up2date | ||
The Kernel and binaries are available for <code><nowiki>i386</nowiki></code> and <code><nowiki>amd64</nowiki></code> | The Kernel and binaries are available for <code><nowiki>i386</nowiki></code> and <code><nowiki>amd64</nowiki></code> | ||
It is possible and supported to run 32bit i386 VServers on an amd64 VServer Kernel. | It is possible and supported to run 32bit i386 VServers on an amd64 VServer Kernel. | ||
=== Distributed Remote Block Device (DRBD) === | === Distributed Remote Block Device (DRBD) === | ||
[http://www.drbd.org DRBD] can be used with VServer to build simple, robust and cheap High Availability (HA) solutions with disaster failover capabilty to a remote location. | [http://www.drbd.org DRBD] can be used with VServer to build simple, robust and cheap High Availability (HA) solutions with disaster failover capabilty to a remote location. | ||
Simply put your VServers on a DRBD and let a heartbeat in another building take over the | Simply put your VServers on a DRBD and let a heartbeat in another building take over the | ||
DRBD and start your VServers. | DRBD and start your VServers. | ||
DRBD utilities and kernel modules for the VServer enabled kernels are available in the above | DRBD utilities and kernel modules for the VServer enabled kernels are available in the above | ||
archive: | archive: | ||
<pre><nowiki> | <pre><nowiki> | ||
apt-get install drbd0.7-module-2.6.15-(dapper_abi+1)-arch drbd0.7-utils </nowiki></pre> | apt-get install drbd0.7-module-2.6.15-(dapper_abi+1)-arch drbd0.7-utils </nowiki></pre> | ||
=== Build Yourself === | === Build Yourself === | ||
I've created a tgz of the diffs and build script I'm using for building the kernel debs. | I've created a tgz of the diffs and build script I'm using for building the kernel debs. | ||
<pre><nowiki> | |||
<pre><nowiki>$ wget http://ubuntu.uni-klu.ac.at/ubuntu.uniklu/dists/dapper/uniklu-vserver/vserver-image-build.tgz | $ wget http://ubuntu.uni-klu.ac.at/ubuntu.uniklu/dists/dapper/uniklu-vserver/vserver-image-build.tgz | ||
$ tar -xzf vserver-image-build.tgz | $ tar -xzf vserver-image-build.tgz | ||
$ cd linux-vserver-2.6.15 | $ cd linux-vserver-2.6.15 | ||
$ ./kbuild.sh </nowiki></pre> | $ ./kbuild.sh </nowiki></pre> | ||
=== Links === | === Links === | ||
* [http://linux-vserver.org/Installation_on_Ubuntu Installation on Ubuntu] | |||
* [http://linux-vserver.org Linux VServer Project] | * [http://linux-vserver.org Linux VServer Project] | ||
* [http://support.uni-klu.ac.at/VServer Uniklu VServer info] | * [http://support.uni-klu.ac.at/VServer Uniklu VServer info] | ||
第152行: | 第112行: | ||
* [http://www.drbd.org DRBD Homepage] | * [http://www.drbd.org DRBD Homepage] | ||
* [http://linux-vserver.org/Vserver+DRBD VServer and DRBD info] | * [http://linux-vserver.org/Vserver+DRBD VServer and DRBD info] | ||
[[category:UbuntuHelp]] | [[category:UbuntuHelp]] |
2009年11月17日 (二) 21:08的最新版本
文章出处: |
{{#if: | {{{2}}} | https://help.ubuntu.com/community/VServer }} |
点击翻译: |
English {{#ifexist: {{#if: UbuntuHelp:VServer | UbuntuHelp:VServer | {{#if: | :}}VServer}}/af | • {{#if: UbuntuHelp:VServer|Afrikaans| [[::VServer/af|Afrikaans]]}}|}} {{#ifexist: {{#if: UbuntuHelp:VServer | UbuntuHelp:VServer | {{#if: | :}}VServer}}/ar | • {{#if: UbuntuHelp:VServer|العربية| [[::VServer/ar|العربية]]}}|}} {{#ifexist: {{#if: UbuntuHelp:VServer | UbuntuHelp:VServer | {{#if: | :}}VServer}}/az | • {{#if: UbuntuHelp:VServer|azərbaycanca| [[::VServer/az|azərbaycanca]]}}|}} {{#ifexist: {{#if: UbuntuHelp:VServer | UbuntuHelp:VServer | {{#if: | :}}VServer}}/bcc | • {{#if: UbuntuHelp:VServer|جهلسری بلوچی| [[::VServer/bcc|جهلسری بلوچی]]}}|}} {{#ifexist: {{#if: UbuntuHelp:VServer | UbuntuHelp:VServer | {{#if: | :}}VServer}}/bg | • {{#if: UbuntuHelp:VServer|български| [[::VServer/bg|български]]}}|}} {{#ifexist: {{#if: UbuntuHelp:VServer | UbuntuHelp:VServer | {{#if: | :}}VServer}}/br | • {{#if: UbuntuHelp:VServer|brezhoneg| [[::VServer/br|brezhoneg]]}}|}} {{#ifexist: {{#if: UbuntuHelp:VServer | UbuntuHelp:VServer | {{#if: | :}}VServer}}/ca | • {{#if: UbuntuHelp:VServer|català| [[::VServer/ca|català]]}}|}} {{#ifexist: {{#if: UbuntuHelp:VServer | UbuntuHelp:VServer | {{#if: | :}}VServer}}/cs | • {{#if: UbuntuHelp:VServer|čeština| [[::VServer/cs|čeština]]}}|}} {{#ifexist: {{#if: UbuntuHelp:VServer | UbuntuHelp:VServer | {{#if: | :}}VServer}}/de | • {{#if: UbuntuHelp:VServer|Deutsch| [[::VServer/de|Deutsch]]}}|}} {{#ifexist: {{#if: UbuntuHelp:VServer | UbuntuHelp:VServer | {{#if: | :}}VServer}}/el | • {{#if: UbuntuHelp:VServer|Ελληνικά| [[::VServer/el|Ελληνικά]]}}|}} {{#ifexist: {{#if: UbuntuHelp:VServer | UbuntuHelp:VServer | {{#if: | :}}VServer}}/es | • {{#if: UbuntuHelp:VServer|español| [[::VServer/es|español]]}}|}} {{#ifexist: {{#if: UbuntuHelp:VServer | UbuntuHelp:VServer | {{#if: | :}}VServer}}/fa | • {{#if: UbuntuHelp:VServer|فارسی| [[::VServer/fa|فارسی]]}}|}} {{#ifexist: {{#if: UbuntuHelp:VServer | UbuntuHelp:VServer | {{#if: | :}}VServer}}/fi | • {{#if: UbuntuHelp:VServer|suomi| [[::VServer/fi|suomi]]}}|}} {{#ifexist: {{#if: UbuntuHelp:VServer | UbuntuHelp:VServer | {{#if: | :}}VServer}}/fr | • {{#if: UbuntuHelp:VServer|français| [[::VServer/fr|français]]}}|}} {{#ifexist: {{#if: UbuntuHelp:VServer | UbuntuHelp:VServer | {{#if: | :}}VServer}}/gu | • {{#if: UbuntuHelp:VServer|ગુજરાતી| [[::VServer/gu|ગુજરાતી]]}}|}} {{#ifexist: {{#if: UbuntuHelp:VServer | UbuntuHelp:VServer | {{#if: | :}}VServer}}/he | • {{#if: UbuntuHelp:VServer|עברית| [[::VServer/he|עברית]]}}|}} {{#ifexist: {{#if: UbuntuHelp:VServer | UbuntuHelp:VServer | {{#if: | :}}VServer}}/hu | • {{#if: UbuntuHelp:VServer|magyar| [[::VServer/hu|magyar]]}}|}} {{#ifexist: {{#if: UbuntuHelp:VServer | UbuntuHelp:VServer | {{#if: | :}}VServer}}/id | • {{#if: UbuntuHelp:VServer|Bahasa Indonesia| [[::VServer/id|Bahasa Indonesia]]}}|}} {{#ifexist: {{#if: UbuntuHelp:VServer | UbuntuHelp:VServer | {{#if: | :}}VServer}}/it | • {{#if: UbuntuHelp:VServer|italiano| [[::VServer/it|italiano]]}}|}} {{#ifexist: {{#if: UbuntuHelp:VServer | UbuntuHelp:VServer | {{#if: | :}}VServer}}/ja | • {{#if: UbuntuHelp:VServer|日本語| [[::VServer/ja|日本語]]}}|}} {{#ifexist: {{#if: UbuntuHelp:VServer | UbuntuHelp:VServer | {{#if: | :}}VServer}}/ko | • {{#if: UbuntuHelp:VServer|한국어| [[::VServer/ko|한국어]]}}|}} {{#ifexist: {{#if: UbuntuHelp:VServer | UbuntuHelp:VServer | {{#if: | :}}VServer}}/ksh | • {{#if: UbuntuHelp:VServer|Ripoarisch| [[::VServer/ksh|Ripoarisch]]}}|}} {{#ifexist: {{#if: UbuntuHelp:VServer | UbuntuHelp:VServer | {{#if: | :}}VServer}}/mr | • {{#if: UbuntuHelp:VServer|मराठी| [[::VServer/mr|मराठी]]}}|}} {{#ifexist: {{#if: UbuntuHelp:VServer | UbuntuHelp:VServer | {{#if: | :}}VServer}}/ms | • {{#if: UbuntuHelp:VServer|Bahasa Melayu| [[::VServer/ms|Bahasa Melayu]]}}|}} {{#ifexist: {{#if: UbuntuHelp:VServer | UbuntuHelp:VServer | {{#if: | :}}VServer}}/nl | • {{#if: UbuntuHelp:VServer|Nederlands| [[::VServer/nl|Nederlands]]}}|}} {{#ifexist: {{#if: UbuntuHelp:VServer | UbuntuHelp:VServer | {{#if: | :}}VServer}}/no | • {{#if: UbuntuHelp:VServer|norsk| [[::VServer/no|norsk]]}}|}} {{#ifexist: {{#if: UbuntuHelp:VServer | UbuntuHelp:VServer | {{#if: | :}}VServer}}/oc | • {{#if: UbuntuHelp:VServer|occitan| [[::VServer/oc|occitan]]}}|}} {{#ifexist: {{#if: UbuntuHelp:VServer | UbuntuHelp:VServer | {{#if: | :}}VServer}}/pl | • {{#if: UbuntuHelp:VServer|polski| [[::VServer/pl|polski]]}}|}} {{#ifexist: {{#if: UbuntuHelp:VServer | UbuntuHelp:VServer | {{#if: | :}}VServer}}/pt | • {{#if: UbuntuHelp:VServer|português| [[::VServer/pt|português]]}}|}} {{#ifexist: {{#if: UbuntuHelp:VServer | UbuntuHelp:VServer | {{#if: | :}}VServer}}/ro | • {{#if: UbuntuHelp:VServer|română| [[::VServer/ro|română]]}}|}} {{#ifexist: {{#if: UbuntuHelp:VServer | UbuntuHelp:VServer | {{#if: | :}}VServer}}/ru | • {{#if: UbuntuHelp:VServer|русский| [[::VServer/ru|русский]]}}|}} {{#ifexist: {{#if: UbuntuHelp:VServer | UbuntuHelp:VServer | {{#if: | :}}VServer}}/si | • {{#if: UbuntuHelp:VServer|සිංහල| [[::VServer/si|සිංහල]]}}|}} {{#ifexist: {{#if: UbuntuHelp:VServer | UbuntuHelp:VServer | {{#if: | :}}VServer}}/sq | • {{#if: UbuntuHelp:VServer|shqip| [[::VServer/sq|shqip]]}}|}} {{#ifexist: {{#if: UbuntuHelp:VServer | UbuntuHelp:VServer | {{#if: | :}}VServer}}/sr | • {{#if: UbuntuHelp:VServer|српски / srpski| [[::VServer/sr|српски / srpski]]}}|}} {{#ifexist: {{#if: UbuntuHelp:VServer | UbuntuHelp:VServer | {{#if: | :}}VServer}}/sv | • {{#if: UbuntuHelp:VServer|svenska| [[::VServer/sv|svenska]]}}|}} {{#ifexist: {{#if: UbuntuHelp:VServer | UbuntuHelp:VServer | {{#if: | :}}VServer}}/th | • {{#if: UbuntuHelp:VServer|ไทย| [[::VServer/th|ไทย]]}}|}} {{#ifexist: {{#if: UbuntuHelp:VServer | UbuntuHelp:VServer | {{#if: | :}}VServer}}/tr | • {{#if: UbuntuHelp:VServer|Türkçe| [[::VServer/tr|Türkçe]]}}|}} {{#ifexist: {{#if: UbuntuHelp:VServer | UbuntuHelp:VServer | {{#if: | :}}VServer}}/vi | • {{#if: UbuntuHelp:VServer|Tiếng Việt| [[::VServer/vi|Tiếng Việt]]}}|}} {{#ifexist: {{#if: UbuntuHelp:VServer | UbuntuHelp:VServer | {{#if: | :}}VServer}}/yue | • {{#if: UbuntuHelp:VServer|粵語| [[::VServer/yue|粵語]]}}|}} {{#ifexist: {{#if: UbuntuHelp:VServer | UbuntuHelp:VServer | {{#if: | :}}VServer}}/zh | • {{#if: UbuntuHelp:VServer|中文| [[::VServer/zh|中文]]}}|}} {{#ifexist: {{#if: UbuntuHelp:VServer | UbuntuHelp:VServer | {{#if: | :}}VServer}}/zh-hans | • {{#if: UbuntuHelp:VServer|中文(简体)| [[::VServer/zh-hans|中文(简体)]]}}|}} {{#ifexist: {{#if: UbuntuHelp:VServer | UbuntuHelp:VServer | {{#if: | :}}VServer}}/zh-hant | • {{#if: UbuntuHelp:VServer|中文(繁體)| [[::VServer/zh-hant|中文(繁體)]]}}|}} |
{{#ifeq:UbuntuHelp:VServer|:VServer|请不要直接编辑翻译本页,本页将定期与来源同步。}} |
{{#ifexist: :VServer/zh | | {{#ifexist: VServer/zh | | {{#ifeq: {{#titleparts:VServer|1|-1|}} | zh | | }} }} }} {{#ifeq: {{#titleparts:VServer|1|-1|}} | zh | | }}
<<Include(Tag/Unsupported)>>
What are VServers
The Linux VServer Project provides multiple Linux environments running inside a single Linux kernel. You can think of it as a bit like running a new system inside a chroot, but with a different host name and IP address, a de-fanged `root` user, and configurable resource management. This is a similar feature to jails on FreeBSD and containers on Solaris 10+. VServers are a different approach to the popular XEN Hypervisor; with XEN you end up with a kernel for each virtual server; VServers do not. So, with VServer you have less (virtually no) overhead, on the other hand you also have fewer features - it is currently impossible to have a VServer with a different time set to the host system, for instance. However it is possible to run a different time zone, as that is a purely user-space feature. The design of UNIX in general mean that for the vast majority of applications, this virtualisation technique is perfectly adequate. Note that Xen and VServer are orthogonal approaches - that is, it is perfectly possible and sometimes even sensible to run Xen virtual machines on a Linux system, then Linux VServers within those Xen machines.
Karmic, Jaunty, Intrepid and Hardy
For Karmic, Jaunty, Intrepid and Hardy there are binary kernel images available. Please take a look at Installation on Ubuntu at the Linux VServer wiki.
Installation (u32)
This describes how to install the VServer-enabled kernel packages built on top of Edgy's stock kernel (source is in http://git.u32.net/). If you want to verify the packages, you can add the package key to apt's keyring (this is optional). As of now packages are only available for x86 and amd64, hopefully more architectures will be supported soon. No kernel pre-built for feisty currently exists for Ubuntu. You'll have to use the Edgy 2.6.17 for now. Also, be careful to install the VServer tools using the Edgy repository, or versions won't match and you'll get segmentation faults.
$ wget -O - http://bronson.rinspin.com/u32-package-key.gpg | sudo apt-key add -
Now add the following repositories to your /etc/apt/sources.list. Read this page for instructions on how to add repositories.
deb http://dpkg.u32.net/ubuntu edgy vserver deb-src http://dpkg.u32.net/ubuntu edgy vserver
Now, install the software packages and the kernel. Instead of vserver-generic, you can also supply any Ubuntu-supported flavor (vserver-i386, vserver-server, etc). Run 'cat /proc/version' to see what flavor kernel you're running now.
$ sudo apt-get install util-vserver vserver-debiantools $ sudo apt-get install linux-vserver-image-2.6.17-11-vserver-generic
And reboot into your new, VServer-enabled kernel. This 2.6.17 Edgy kernel runs just fine on Dapper as well. Occasionally dpkg may stop claiming "error in postinst." This is just a bad interaction between older and newer kernel tools and, other than preventing the install from completing, it's harmless. Just purge and reinstall and it should work. You may want to run run ln -sf /vservers /etc/vservers/.defaults/vdirbase to specify where your vservers should reside (this puts them in /vservers). By default they are stored in /var/lib/vservers. The git tree for the patched kernel can be downloaded from http://git.u32.net.
Create a new guest
/etc/vservers/newvserver-vars (man newvserver(1) for options): DIST='dapper' MIRROR="http://us.archive.ubuntu.com/ubuntu" This command creates a new Ubuntu Dapper image. You can change "dapper" to "edgy" or whatever you want above. You can run virtually any Linux distribution as a guest (for instance, Gentoo). newvserver -v --hostname NAME --domain EXAMPLE.COM --interface ETHX --ip IPADDRESS See this page for some tweaks to make your Dapper guest a little more vserver-friendly. Run 'vserver NAME start' to start your new guest image, then 'vserver NAME enter' to use it.
Installation (Uniklu)
Installation is quite simple - you need:
- Kernel with VServer patch
- util-vserver
- vserver-debiantools
You can install these packages if you add the following lines to your sources.list:
- dapper
deb http://ubuntu.uni-klu.ac.at/ubuntu.uniklu/ dapper uniklu-vserver
- deb-src http://ubuntu.uni-klu.ac.at/ubuntu.uniklu/ dapper uniklu-vserver
- edgy (not needed, already in universe)
The uniklu archives are signed - if you want get rid of apt-get warnings:
$ wget -nv http://ubuntu.uni-klu.ac.at/uniklu-debuild.pub -O - | sudo apt-key add -
To install the VServer Kernel and utils enter:
- dapper
- apt-get install linux-image-2.6.15-(dapper_abi+1)-686
- apt-get install util-vserver vserver-debiantools
- edgy
- apt-get install kernel-patch-vserver
- apt-get install util-vserver
You should get the following revisions
- dapper
kernel | -(dapper_abi+1)-2.6.15-(dapper_abi+1).(dapper_release)vs |
util-vserver | >= 0.30.210-0uk |
vserver-debiantools | >= 0.2.6 |
- edgy
kernel-patch-vserver | 2:2.0.1-4 |
util-vserver | 0.30.210-10 |
vserver-debiantools | 0.2.6 |
At the moment the kernel is one revision behind the offical Ubuntu Kernel - will be fixed soon !
Make sure you install the kernel from the uniklu-vserver archive.
You may want to remove linux-image-<arch>-<kernel_type>
and linux-<arch>-<kernel_type>
.
Also, you may create /etc/apt/preferences
file with content:
Package: * Pin: release v=6.04*,a=dapper,c=uniklu-vserver,o=UniversityKlagenfurt,l=uniklu Pin-Priority: 1001
The vserver-debiantools do not work 100% but should help you setting your first vserver quickly - see Uniklu VServer Info The Kernel is the standard Ubuntu Kernel with the Vserver patch applied.
- dapper: Vserver patch >= 2.0.2-rc13 for kernel-2.6.15
- edgy: patch from universe should be up2date
The Kernel and binaries are available for i386
and amd64
It is possible and supported to run 32bit i386 VServers on an amd64 VServer Kernel.
Distributed Remote Block Device (DRBD)
DRBD can be used with VServer to build simple, robust and cheap High Availability (HA) solutions with disaster failover capabilty to a remote location. Simply put your VServers on a DRBD and let a heartbeat in another building take over the DRBD and start your VServers. DRBD utilities and kernel modules for the VServer enabled kernels are available in the above archive:
apt-get install drbd0.7-module-2.6.15-(dapper_abi+1)-arch drbd0.7-utils
Build Yourself
I've created a tgz of the diffs and build script I'm using for building the kernel debs.
$ wget http://ubuntu.uni-klu.ac.at/ubuntu.uniklu/dists/dapper/uniklu-vserver/vserver-image-build.tgz $ tar -xzf vserver-image-build.tgz $ cd linux-vserver-2.6.15 $ ./kbuild.sh