Difference between revisions of "util-vserver:Howto virtualize an exisiting Linux server"

From Linux-VServer

Jump to: navigation, search
 
(11 intermediate revisions by 6 users not shown)
Line 6: Line 6:
 
  rm -rf /vservers/yourguest/*
 
  rm -rf /vservers/yourguest/*
 
* Copy your old server to the previous folder
 
* Copy your old server to the previous folder
  rsync -rv --progress --partial yourguest:/  /vservers/yourguest/
+
  rsync -av --numeric-ids --progress --partial --exclude '/proc/*' yourguest:/  /vservers/yourguest/
''Why yourguest:/ shouldn't that be / ?''
+
 
Answer: You're now on the host server about to copy an existing installation on another hardware.
+
''Why yourguest:/ shouldn't that be / ?''
 +
Answer: You're now on the host server about to copy an existing installation on another hardware.
 +
 
guest on the host, not the guest.
 
guest on the host, not the guest.
 
* Remove the fstab
 
* Remove the fstab
Line 16: Line 18:
 
  rm /vservers/yourguest/etc/rc.d/init.d/.....
 
  rm /vservers/yourguest/etc/rc.d/init.d/.....
 
  ''What are the troubled services? What is the minimal setup to make it work?''
 
  ''What are the troubled services? What is the minimal setup to make it work?''
 +
Answer: Any hardware related services will be troubled and should be removed.
 
* Disable Pam authentification for ssh access
 
* Disable Pam authentification for ssh access
 
  edit /vservers/yourguest/etc/ssh/sshd_config  ->  (UsePAM no)
 
  edit /vservers/yourguest/etc/ssh/sshd_config  ->  (UsePAM no)
Line 22: Line 25:
 
  rm /etc/modprobe.conf
 
  rm /etc/modprobe.conf
 
  ''Do you mean editing modprobe.conf? Why delete the file?''
 
  ''Do you mean editing modprobe.conf? Why delete the file?''
 +
Answer: Probing modules make no sense in a virtual environment.
 
* Start your vserver !
 
* Start your vserver !
 
  vserver yourguest start
 
  vserver yourguest start
 +
 +
[[Category:OS guest under linux-vserver]]
 +
[[Category:Configuration]]
 +
[[Category:Migration]]

Latest revision as of 22:22, 21 October 2011

[edit] Virtualize CentOS4

  • Create a regular guest
vserver yourguest build ...
  • Empty the just created guest
rm -rf /vservers/yourguest/*
  • Copy your old server to the previous folder
rsync -av --numeric-ids --progress --partial --exclude '/proc/*' yourguest:/  /vservers/yourguest/

Why yourguest:/ shouldn't that be / ? Answer: You're now on the host server about to copy an existing installation on another hardware.

guest on the host, not the guest.

  • Remove the fstab
rm /vservers/yourguest/etc/fstab
  • Remove the services that makes troubles at start
rm /vservers/yourguest/etc/rc.d/init.d/network
rm /vservers/yourguest/etc/rc.d/init.d/.....
What are the troubled services? What is the minimal setup to make it work?
Answer: Any hardware related services will be troubled and should be removed.
  • Disable Pam authentification for ssh access
edit /vservers/yourguest/etc/ssh/sshd_config  ->  (UsePAM no)
replace # Listen with Listen yourguestip (this has to been done on the host too is your host ip)
  • Remove the useless modules
rm /etc/modprobe.conf
Do you mean editing modprobe.conf? Why delete the file?
Answer: Probing modules make no sense in a virtual environment.
  • Start your vserver !
vserver yourguest start
Personal tools