Editing
Installation on ArchLinux
(section)
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!
==Creating an Arch Linux VServer== Download [http://www.linux-stats.org/download/archbootstrap archbootstrap] (this script will run on any GNU/Linux host system with wget), choose appropriate values for name, interface and {{context}, pick some vserver flags (or just use the ones below) then use the following shell commands to create your vserver: ''(choose a mirror close to you, as archbootstrap will download all base packages)'' <pre> # name=test # interface=eth0:72.36.180.187/29 # context=5 # vserver ${name} build -m skeleton --context ${context} --interface ${interface} \ --flags lock,virt_mem,virt_uptime,virt_cpu,virt_load,sched_hard,hide_netif --initstyle plain # echo default > /etc/vservers/${name}/apps/init/mark # archbootstrap /vservers/${name} ftp://ftp.archlinux.de/pub/archlinux # chattr +i /vservers/${name}/dev ... </pre> If you don't have a public ip to spare for your vserver guest, then you must create guest with private ip, like 192.168.0.103 for example. Then in order to allow guest to access the Internet, you will have to set up proper NAT rule for your host's iptables. Assuming that you are using addresses like in previous example, a working NAT rule is this: iptables -t nat -I POSTROUTING -s 192.168.0.0/24 -j SNAT --to x.x.x.x where the last one is your host's public ip, assuming that it can access the Internet directly. You can now test if NAT rule succeeded by using this command: iptables -t nat -L It should display an output like this: Chain POSTROUTING (policy ACCEPT) target prot opt source destination SNAT all -- 192.168.0.0/24 anywhere to:x.x.x.x Remeber to copy /etc/resolv.conf to /vservers/${name}/etc to be able to use domain names instead of just ip addresses. If you plan to set up servers to your guest, it would also be useful to have localhost in there. This can be achieved by creating a new folder in /etc/vservers/name/interfaces/ - name the folder 1, for example, if the previous one that exists there is 0. Then create there files named ip, dev and prefix. To ip write 127.0.0.1, to dev write lo and to prefix write 32. Start your vserver: # vserver ${name} start Check it has started # vserver-stat Then enter the guest (vserver name enter) and at first create iproute package (it is at <tt>/var/abs/network/iproute</tt>) - you will need it to see ip addresses and other needful information. Add the package and now to see how networking is working use this command ip addr show and try to ping the world. That is pretty much it. You will probably want to edit <tt>/vservers/test/etc/rc.conf </tt>to remove interface configuration and set your hostname. All the usual vserver commands should work as you would expect, but don't forget to modify host service config files so they don't bind to INADDR_ANY. ;Note: the value in <tt>/etc/vservers/${name}/apps/init/mark</tt> must be default if you wish your vservers to start at boot using the vservers-default init script. ;Note2: if on starting up a vserver the keyboard control is lost on host, remove console from /dev of vserver [[Category:Installation]]
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