Difference between revisions of "User:Supaplex/my vserver install notes"

From Freeside
Jump to: navigation, search
(Guest Steps)
 
(9 intermediate revisions by the same user not shown)
Line 1: Line 1:
My steps.
+
My steps to install a FS guest on vserver.
  
 +
== VServer host ==
  
 
<code><pre>
 
<code><pre>
# preflight checklist for guest: /etc/network/interfaces dnsmasq:/etc/hosts ip
+
# preflight checklist on host/net: /etc/network/interfaces dnsmasq:/etc/hosts ip
  
 
# set these accordingly
 
# set these accordingly
Line 35: Line 36:
  
 
guest_vdir=$(readlink /etc/vservers/${guest}/vdir)
 
guest_vdir=$(readlink /etc/vservers/${guest}/vdir)
 +
 +
sed 's/^/# /' -i.bak ${guest_vdir}/etc/apt/sources.list
  
 
echo "deb http://security.debian.org/ etch/updates main contrib non-free
 
echo "deb http://security.debian.org/ etch/updates main contrib non-free
Line 48: Line 51:
 
</pre></code>
 
</pre></code>
  
 +
== Guest Steps ==
  
 
<code><pre>
 
<code><pre>
export LANG=C
+
echo export LANG=C >> /etc/environ
 +
source /etc/environ
 +
echo source /etc/environ >> /etc/profile
 
aptitude update
 
aptitude update
 
aptitude upgrade
 
aptitude upgrade
  
 
# Stuff I install
 
# Stuff I install
aptitude install vim less strace ssh
+
aptitude install vim less strace ssh screen && update-alternatives --set editor /usr/bin/vim.basic
 +
 
 +
# Setting the TimeZone
 +
editor /etc/default/rcS
 +
tzconfig
  
 
# now's a good time to configure ssh to listen on ${guest_ip} (per vserver caveat), change/disable passwords and copy ssh keys.
 
# now's a good time to configure ssh to listen on ${guest_ip} (per vserver caveat), change/disable passwords and copy ssh keys.
 +
# Afterwards, log out of the vserver guest, and login via ssh.
 
</pre></code>
 
</pre></code>
 +
 +
== See Also ==
 +
# [http://www.debian.org/releases/stable/i386/apds03.html.en#id2551154 "Setting TimeZone"], debian.org, 2007-03-20.
 +
 +
== Finally ==
  
 
Next: [[Freeside:1.7:Documentation:InstallingOnDebian|Installing on Debian]]
 
Next: [[Freeside:1.7:Documentation:InstallingOnDebian|Installing on Debian]]

Latest revision as of 08:15, 4 February 2008

My steps to install a FS guest on vserver.

VServer host

# preflight checklist on host/net: /etc/network/interfaces dnsmasq:/etc/hosts ip

# set these accordingly
export guest=fshead
export guest_dist=etch
export guest_mirror=ftp://mirrors.xmission.com/debian/

# hint: grep ^iface /etc/network/interfaces

# my shortcuts
export guest_if=eth0:$(grep ^iface\ eth0: /etc/network/interfaces | tr ':' ' ' | awk '{print $3}' | sort -n | tail -n 1)
export guest_ip=$(grep -A 10 ${guest_if} /etc/network/interfaces | perl -ne'print "$1\n" if /^\s*address ([0-9.]+)/' | head -n 1)
export guest_cidr= Net::CIDR anyone? :)

# yours
export guest_if=
export guest_ip=
export guest_cidr=

# debootstrap+vserver guest install
vserver $guest build -m debootstrap -- -d ${guest_dist} -m ${guest_mirror}
cd /etc/vservers/${guest}/
echo ${guest} > uts/nodename

# network setup
mkdir interfaces/0
cd interfaces/0
echo ${guest_if} > dev
echo ${guest_ip} > ip
echo ${guest_cidr} > prefix

guest_vdir=$(readlink /etc/vservers/${guest}/vdir)

sed 's/^/# /' -i.bak ${guest_vdir}/etc/apt/sources.list

echo "deb http://security.debian.org/ etch/updates main contrib non-free
deb "${guest_mirror}" etch main contrib non-free" > ${guest_vdir}/etc/apt/sources.list.d/${guest_dist}.list

echo "deb http://420.am/~ivan/freeside-"${guest_dist}"/ ./" > ${guest_vdir}/etc/apt/sources.list.d/freeside.list

# dnsmasq:
echo -e "echo "${guest_ip}"\t"${guest}'>> /etc/hosts && /etc/init.d/dnsmasq restart'

vserver ${guest} start
vserver ${guest} enter

Guest Steps

echo export LANG=C >> /etc/environ
source /etc/environ
echo source /etc/environ >> /etc/profile
aptitude update
aptitude upgrade

# Stuff I install
aptitude install vim less strace ssh screen && update-alternatives --set editor /usr/bin/vim.basic

# Setting the TimeZone
editor /etc/default/rcS
tzconfig

# now's a good time to configure ssh to listen on ${guest_ip} (per vserver caveat), change/disable passwords and copy ssh keys.
# Afterwards, log out of the vserver guest, and login via ssh.

See Also

  1. "Setting TimeZone", debian.org, 2007-03-20.

Finally

Next: Installing on Debian