Installing an openSUSE vserver guest: Difference between revisions
From Linix VServer
Jump to navigationJump to search
imported>Mstrobert (→Installation: typo) |
imported>Glenn (catspec) |
||
| (19 intermediate revisions by 2 users not shown) | |||
| Line 1: | Line 1: | ||
Installing and running openSUSE (previously knows as SUSE Linux) as a vserver guest. | |||
__TOC__ | |||
==Test configuration== | ==Test configuration== | ||
Host: | Host: | ||
* Debian Etch AMD64 | * Debian Etch AMD64, Kernel 2.6.15.4-vs2.0.2-rc9, util-vserver 0.30.210 + similar patch, or | ||
* Debian Etch AMD64, 2.6.18-4-vserver-amd64, util-vserver 0.30.212-1 + patch (see below) | |||
* util-vserver 0.30. | |||
Guest: | Guest: | ||
* SLES 9 | * SLES 9, or | ||
==Running | * openSUSE 10.2 | ||
==Running openSUSE vservers on a Debian server== | |||
===Installation=== | ===Installation=== | ||
Debian is lacking the required rpm tools to install | Debian is lacking the required rpm tools to install an openSUSE or SLES system directly via vserver build (the required apt-rpm is available in source only for apt-0.5.xx, and Debian is already at 0.6.xx). | ||
Therefore, use the normal | Therefore, use the normal openSUSE installation procedure and then copy the system to a vserver directory: | ||
* Install | * Install openSUSE on raw metal or in a virtual machine (such as [http://www.virtualbox.org/ VirtualBox]). | ||
* Boot from CD ( | * Boot from CD (openSUSE or Debian - whatever you prefer), or just boot into the OS and log in as root. | ||
* tar the whole system, copy it to the vserver host and untar it to the desired vserver location, usually <code>/var/lib/vservers/<servername></code> | * tar the whole system, copy it to the vserver host and untar it to the desired vserver location, usually <code>/var/lib/vservers/<servername></code> | ||
* Create <code>/etc/ | * Create <code>/etc/vservers/<servername></code> manually, or copy it from another vserver. | ||
=== | ===Post install cleanup=== | ||
* remove some startup service, either delete the /etc/init.d/.... links or run the following from inside the vserver: | * remove some startup service, either delete the appropriate /etc/init.d/.... links or run the following from inside the vserver: | ||
chkconfig -d -f boot.swap boot.isapnp boot.idedma boot.loadmodules \ | # chkconfig -d -f boot.swap boot.isapnp boot.idedma boot.loadmodules \ | ||
boot.device-mapper boot.md boot.proc boot.shm boot.sched \ | |||
boot.rootfsck hotplug boot.localfs boot.crypto boot.clock \ | |||
boot.scpm boot.ipconfig | |||
chkconfig -d -f coldplug irq_balancer random network fbset powersaved kbd hwscan | # chkconfig -d -f coldplug irq_balancer random network fbset powersaved kbd hwscan | ||
* remove unneeded packages: | * remove unneeded packages: | ||
rpm -e irqbalance kernel-smp grub reiserfs xfsprogs raidtools ntfsprogs \ | # rpm -e irqbalance kernel-smp grub reiserfs xfsprogs raidtools ntfsprogs \ | ||
module-init-tools mkinitrd powersave hotplug mdadm | |||
'''Note:''' there are a number of redundant packages remaining that can not be removed due to yast2 depending on them. | '''Note:''' there are a number of redundant packages remaining that can not be removed due to yast2 depending on them. | ||
===initscripts=== | ===initscripts=== | ||
openSUSE's <code>/etc/init.d/rc</code> expects two environment variables: <code>RUNLEVEL</code> and <code>PREVLEVEL</code>. The vserver.start script fails to set those. There are a couple workarounds: | |||
* Edit <code>/etc/init.d/rc</code> to set those values (not recommended (why?)). For example, inserting these lines near the top of the file: | |||
PREVLEVEL="N" | |||
--- vserver.start | RUNLEVEL="$1" | ||
+++ vserver.start | * Apply the following patch to <code>vserver.start</code> to set the values: | ||
@@ - | --- vserver.start,orig 2006-12-09 12:37:58.000000000 -0700 | ||
+++ vserver.start 2007-06-11 12:27:27.000000000 -0600 | |||
@@ -141,7 +141,7 @@ | |||
$_VUNAME --xid self --set -t context="$VSERVER_DIR" -- \ | $_VUNAME --xid self --set -t context="$VSERVER_DIR" -- \ | ||
$_VATTRIBUTE --set "${OPTS_VATTRIBUTE[@]}" -- \ | $_VATTRIBUTE --set "${OPTS_VATTRIBUTE[@]}" -- \ | ||
$_SAVE_CTXINFO "$VSERVER_DIR" \ | $_SAVE_CTXINFO "$VSERVER_DIR" \ | ||
- $_ENV -i | - $_ENV -i "${OPTS_ENV[@]}" \ | ||
+ $_ENV -i | + $_ENV -i "${OPTS_ENV[@]}" PREVLEVEL="N" RUNLEVEL="$RUNLEVEL_START" \ | ||
$_VCONTEXT --migrate-self --endsetup --chroot $SILENT_OPT \ | $_VCONTEXT --migrate-self --endsetup --chroot $SILENT_OPT \ | ||
"${OPTS_VCONTEXT_MIGRATE[@]}" "${OPTS_VCONTEXT_ENTER[@]}" -- \ | "${OPTS_VCONTEXT_MIGRATE[@]}" "${OPTS_VCONTEXT_ENTER[@]}" -- \ | ||
"${INITCMD_START[@]}" | "${INITCMD_START[@]}" | ||
@@ - | @@ -157,7 +157,7 @@ | ||
$_EXEC_ULIMIT "$VSERVER_DIR/ulimits" \ | $_EXEC_ULIMIT "$VSERVER_DIR/ulimits" \ | ||
$_CHCONTEXT_COMPAT "${CHCONTEXT_OPTS[@]}" "${CHCONTEXT_INIT_OPTS[@]}" \ | $_CHCONTEXT_COMPAT "${CHCONTEXT_OPTS[@]}" "${CHCONTEXT_INIT_OPTS[@]}" \ | ||
$_SAVE_CTXINFO "$VSERVER_DIR" \ | $_SAVE_CTXINFO "$VSERVER_DIR" \ | ||
- $_ENV -i | - $_ENV -i "${OPTS_ENV[@]}" \ | ||
+ $_ENV -i | + $_ENV -i "${OPTS_ENV[@]}" PREVLEVEL="N" RUNLEVEL="$RUNLEVEL_START" \ | ||
$_CHAINECHO "${_IS_FAKEINIT:+$startsync_pipe}" "" \ | $_CHAINECHO "${_IS_FAKEINIT:+$startsync_pipe}" "" \ | ||
$_CAPCHROOT "${CAPCHROOT_OPTS[@]}" . \ | $_CAPCHROOT "${CAPCHROOT_OPTS[@]}" . \ | ||
"${INITCMD_START[@]}" | "${INITCMD_START[@]}" | ||
'''edit me:''' do we need to modify the vserver.stop script as well? | '''edit me:''' do we need to modify the <code>vserver.stop</code> script as well? | ||
[[Category:OS guest under linux-vserver]] | |||
Latest revision as of 20:53, 21 October 2011
Installing and running openSUSE (previously knows as SUSE Linux) as a vserver guest.
Test configuration[edit]
Host:
- Debian Etch AMD64, Kernel 2.6.15.4-vs2.0.2-rc9, util-vserver 0.30.210 + similar patch, or
- Debian Etch AMD64, 2.6.18-4-vserver-amd64, util-vserver 0.30.212-1 + patch (see below)
Guest:
- SLES 9, or
- openSUSE 10.2
Running openSUSE vservers on a Debian server[edit]
Installation[edit]
Debian is lacking the required rpm tools to install an openSUSE or SLES system directly via vserver build (the required apt-rpm is available in source only for apt-0.5.xx, and Debian is already at 0.6.xx).
Therefore, use the normal openSUSE installation procedure and then copy the system to a vserver directory:
- Install openSUSE on raw metal or in a virtual machine (such as VirtualBox).
- Boot from CD (openSUSE or Debian - whatever you prefer), or just boot into the OS and log in as root.
- tar the whole system, copy it to the vserver host and untar it to the desired vserver location, usually
/var/lib/vservers/<servername> - Create
/etc/vservers/<servername>manually, or copy it from another vserver.
Post install cleanup[edit]
- remove some startup service, either delete the appropriate /etc/init.d/.... links or run the following from inside the vserver:
# chkconfig -d -f boot.swap boot.isapnp boot.idedma boot.loadmodules \
boot.device-mapper boot.md boot.proc boot.shm boot.sched \
boot.rootfsck hotplug boot.localfs boot.crypto boot.clock \
boot.scpm boot.ipconfig
# chkconfig -d -f coldplug irq_balancer random network fbset powersaved kbd hwscan
- remove unneeded packages:
# rpm -e irqbalance kernel-smp grub reiserfs xfsprogs raidtools ntfsprogs \
module-init-tools mkinitrd powersave hotplug mdadm
Note: there are a number of redundant packages remaining that can not be removed due to yast2 depending on them.
initscripts[edit]
openSUSE's /etc/init.d/rc expects two environment variables: RUNLEVEL and PREVLEVEL. The vserver.start script fails to set those. There are a couple workarounds:
- Edit
/etc/init.d/rcto set those values (not recommended (why?)). For example, inserting these lines near the top of the file:
PREVLEVEL="N" RUNLEVEL="$1"
- Apply the following patch to
vserver.startto set the values:
--- vserver.start,orig 2006-12-09 12:37:58.000000000 -0700
+++ vserver.start 2007-06-11 12:27:27.000000000 -0600
@@ -141,7 +141,7 @@
$_VUNAME --xid self --set -t context="$VSERVER_DIR" -- \
$_VATTRIBUTE --set "${OPTS_VATTRIBUTE[@]}" -- \
$_SAVE_CTXINFO "$VSERVER_DIR" \
- $_ENV -i "${OPTS_ENV[@]}" \
+ $_ENV -i "${OPTS_ENV[@]}" PREVLEVEL="N" RUNLEVEL="$RUNLEVEL_START" \
$_VCONTEXT --migrate-self --endsetup --chroot $SILENT_OPT \
"${OPTS_VCONTEXT_MIGRATE[@]}" "${OPTS_VCONTEXT_ENTER[@]}" -- \
"${INITCMD_START[@]}"
@@ -157,7 +157,7 @@
$_EXEC_ULIMIT "$VSERVER_DIR/ulimits" \
$_CHCONTEXT_COMPAT "${CHCONTEXT_OPTS[@]}" "${CHCONTEXT_INIT_OPTS[@]}" \
$_SAVE_CTXINFO "$VSERVER_DIR" \
- $_ENV -i "${OPTS_ENV[@]}" \
+ $_ENV -i "${OPTS_ENV[@]}" PREVLEVEL="N" RUNLEVEL="$RUNLEVEL_START" \
$_CHAINECHO "${_IS_FAKEINIT:+$startsync_pipe}" "" \
$_CAPCHROOT "${CAPCHROOT_OPTS[@]}" . \
"${INITCMD_START[@]}"
edit me: do we need to modify the vserver.stop script as well?