Editing
Wheezy-guest-build-scripts
From Linix VServer
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
A simple build script for wheezy guest: <pre> #!/bin/bash # Serge Pawlowicz, <linux-vserver@pawlowicz.name>, GNU Free Documentation License 1.2 : ${1?"Usage: $0 mxc2.it-zone.org 1001 10.13.10.1 /vservers"} set -x -e #### NAME=$1 CONTEXT=$2 IP=$3 #LOC=$4 DIR=$4 #### NICEBUILD="ionice -c 3 chrt --idle 0" NICE=10 MEMORY=4G MEMSW=5G # i am using apt cacher: apt-cache-ng - but you can adapt the scripot to utiize other mirrors setting PROXY to "http:/" #PROXY="http:/" PROXY=http://10.100.100.2:3142 MIRROR=$PROXY/free.hands.com/debian #MIRROR=http://http.debian.net/debian SECURITY=$PROXY/security.debian.org/ DOTDEB=$PROXY/packages.dotdeb.org PERCONA=$PROXY/repo.percona.com/apt IFACE4=dummy0 IP6=${IP//./:} IP6PRE="2000:45a4:89:63b" # prefix from your uplink IP6PREFIX="/64" # prety standard one is /64 IFACE6=eth1 # iface # SHORT=`echo $NAME|cut -f1 -d\.` $NICEBUILD vserver $SHORT build -m debootstrap --hostname $NAME --context $CONTEXT \ --interface $IFACE4:$IP/32 \ --initstyle sysv \ --interface $IFACE6:$IP6PRE:$IP6$IP6PREFIX \ --root $DIR \ --flags VIRT_MEM \ -- -d wheezy -m $MIRROR -- --verbose --components main,contrib,non-free \ --include openssh-client,openssh-server,locales,locales-all,less,iproute,\ htop,vim-syntax-gtk,rsync,build-essential,libssl-dev,tcpdump,libglib2.0dev,\ liblua5.1-0-dev,libpcre3-dev,subversion,sudo,psmisc,python,strace,git-core,\ apg,byobu,vim,nullmailer,w3m,bind9-host,wget,curl echo default > /etc/vservers/$SHORT/apps/init/mark echo $NICE > /etc/vservers/$SHORT/nice mkdir /etc/vservers/$SHORT/cgroup || true echo $MEMORY > /etc/vservers/$SHORT/cgroup/memory.limit_in_bytes echo $MEMSW > /etc/vservers/$SHORT/cgroup/memory.memsw.limit_in_bytes #echo VIRT_MEM > /etc/vservers/$SHORT/flags vserver $SHORT start cat > $DIR/$SHORT/etc/apt/sources.list <<EOF deb $MIRROR wheezy main contrib non-free deb $MIRROR wheezy-backports main contrib non-free deb $SECURITY wheezy/updates main contrib non-free deb $DOTDEB wheezy all deb $PERCONA wheezy main EOF cat > $DIR/$SHORT/etc/apt/preferences.d/backports <<EOF Package: * Pin: release a=wheezy-backports Pin-Priority: 500 EOF cat > $DIR/$SHORT/etc/apt/preferences.d/dotdeb <<EOF Package: * Pin: release l=packages.dotdeb.org Pin-Priority: 550 EOF cat > $DIR/$SHORT/etc/apt/preferences.d/percona <<EOF Package: * Pin: release o=Percona Development Team Pin-Priority: 1001 EOF # vserver $SHORT curl http://www.dotdeb.org/dotdeb.gpg > /tmp/dotdeb.gpg && cat dotdeb.gpg | apt-key add - vserver $SHORT gpg --keyserver hkp://keys.gnupg.net --recv-keys 1C4CBDCDCD2EFD2A && gpg -a --export CD2EFD2A | apt-key add - vserver $SHORT apt-get --assume-yes --force-yes -f install vserver $SHORT apt-get --assume-yes --force-yes update vserver $SHORT apt-get --assume-yes --force-yes dist-upgrade vserver $SHORT exec apt-get clean vserver $SHORT stop vserver $SHORT start </pre>
Summary:
Please note that all contributions to Linix VServer may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Linix VServer:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Page actions
Page
Discussion
Read
Edit
History
Page actions
Page
Discussion
More
Tools
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
About
Overview
Paper
News
Developers
Donations
Search
Getting Started
Downloads
FAQs
Documentation
Support
Participate
How to participate
Report a Bug
Communicate
Teams/Projects
Hall of Fame
Resources
Archives
Recent Wiki Changes
Pastebin
Related Projects
VServer Hosting
Happy VServer Users
Tools
What links here
Related changes
Special pages
Page information