Difference between revisions of "Virtual Private Server"

From ArchWiki
Jump to: navigation, search
(Providers that offer Arch Linux: added note about invalid release version number for clodo.ru)
(Converting Openstack and Xen components to systemd: no (wrong) pacman instructions, see Help:Style#Official packages)
(43 intermediate revisions by 27 users not shown)
Line 17: Line 17:
 
{| border="1"
 
{| border="1"
 
! Provider !! Arch Release !! Virtualization !! Locations !! Notes
 
! Provider !! Arch Release !! Virtualization !! Locations !! Notes
 +
|-
 +
| [http://123systems.net 123 Systems] || 2010.05 i686/x86_64 || OpenVZ || Dallas, TX || Arch available as a selection upon reinstall. Very old (2.6.18-308) kernel - See [[Virtual_Private_Server#OpenVZ:_kernel_too_old_for_glibc|OpenVZ troubleshooting]].
 +
|-
 +
| [http://afterburst.com/ Afterburst] || 2012.12.01 i686/x86_64 || OpenVZ || Miami (USA), Falkenstein (Germany) || Formerly FanaticalVPS, kernel version depends on what node your VPS is on, the ones in Miami are fine (2.6.32-042stab072.10) but some of the ones in Germany require a [[Virtual_Private_Server#OpenVZ:_kernel_too_old_for_glibc|custom glibc]].
 
|-
 
|-
 
| [http://alienvps.com/ AlienVPS] || 2010.05 || Xen, KVM || Los Angeles, New York ||
 
| [http://alienvps.com/ AlienVPS] || 2010.05 || Xen, KVM || Los Angeles, New York ||
Line 22: Line 26:
 
| [https://www.clodo.ru/ Clodo.ru] || 2011.?? || Xen || Moscow || Can pay per hour. Lists an invalid release version of the installer.
 
| [https://www.clodo.ru/ Clodo.ru] || 2011.?? || Xen || Moscow || Can pay per hour. Lists an invalid release version of the installer.
 
|-
 
|-
| [http://en.edis.at/ Edis] || 2011.08 i686/x86_64 || vServer, KVM || Austria, Switzerland, Germany, UK, Italy, USA, Sweden, France, Poland, Iceland, Hong Kong ||
+
| [http://en.edis.at/ Edis] || 2013.03.01 i686/x86_64 || vServer, KVM || Austria, Chile, Germany, France, Hong Kong, Italy, Iceland, Poland, Sweden, Switzerland, Spain, UK, USA ||
 
|-
 
|-
 
| [http://eoreality.net/ EOReality] || (?) i686/x86_64 || OpenVZ || Chicago || Need to use special glibc-vps repo for this provider . See [[Virtual_Private_Server#OpenVZ:_kernel_too_old_for_glibc|OpenVZ troubleshooting]] for instructions.  You will also need to remove heimdal.
 
| [http://eoreality.net/ EOReality] || (?) i686/x86_64 || OpenVZ || Chicago || Need to use special glibc-vps repo for this provider . See [[Virtual_Private_Server#OpenVZ:_kernel_too_old_for_glibc|OpenVZ troubleshooting]] for instructions.  You will also need to remove heimdal.
 
|-
 
|-
| [http://fanaticalvps.com/ FanaticalVPS] || 2010.05 i686/x86_64 || OpenVZ || Nuremburg ||
+
| [https://www.directvps.nl/ DirectVPS] || 2012.09 x86_64 || Xen || Amsterdam, Rotterdam ||
 +
|-
 +
| [http://generation-host.com Generation-Host] || 2012.07 || Xen || Chicago IL, Clifton NJ and Toronto ON Canada ||
 
|-
 
|-
 
| [https://www.gigatux.com/virtual.php GigaTux] || 2011.08 x86_64 || Xen || Chicago, Frankfurt, Israel, London, San Jose ||
 
| [https://www.gigatux.com/virtual.php GigaTux] || 2011.08 x86_64 || Xen || Chicago, Frankfurt, Israel, London, San Jose ||
Line 39: Line 45:
 
|-
 
|-
 
| [http://lylix.net/home Lylix] || 2007.08 || ? || ? ||
 
| [http://lylix.net/home Lylix] || 2007.08 || ? || ? ||
 +
|-
 +
| [http://www.nodedeploy.com Node Deploy] || ? || OpenVZ, KVM || LA, Germany || unmanaged, solusvm server manager
 +
|-
 +
| [http://netcup.de Netcup] || 2011.10 x86_64/2012.11 x86_64 || vServer, KVM || Germany ||
 +
|-
 +
| [http://onepoundwebhosting.co.uk OnePoundWebHosting] || 2012.09 x86_64 || Xen || UK ||
 
|-
 
|-
 
| [http://openvz.ca/ OpenVZ.ca] || 2010.05 i686/x86_64 || OpenVZ || Canada ||
 
| [http://openvz.ca/ OpenVZ.ca] || 2010.05 i686/x86_64 || OpenVZ || Canada ||
Line 44: Line 56:
 
| [https://www.proplay.biz/ proPlay.de] || 2011.10 i686/x86_64 || OpenVZ, KVM || Germany ||
 
| [https://www.proplay.biz/ proPlay.de] || 2011.10 i686/x86_64 || OpenVZ, KVM || Germany ||
 
|-
 
|-
| [http://www.rackspace.com/cloud/cloud_hosting_products/servers/ Rackspace Cloud] || 2011.10 || Xen || Chicago, Dallas, London, Hong Kong || Can pay per hour.
+
| [http://www.rackspace.com/cloud/cloud_hosting_products/servers/ Rackspace Cloud] || 2013.2 || Xen || Chicago, Dallas, London || Billed per hour.
 
|-
 
|-
| [http://www.ramhost.us RamHost.us] || 2009.10 || OpenVZ, KVM || Atlanta, England, Germany, Los Angeles ||
+
| [http://www.ramhost.us RamHost.us] || 2012.12 || OpenVZ, KVM || Atlanta, England, Germany, Los Angeles || You can request a newer iso on IRC. ||
 
|-
 
|-
| [http://www.tilaa.nl/ Tilaa] || 2011.08 i686/x86_64 || KVM || Amsterdam ||
+
| [http://www.tilaa.nl/ Tilaa] || 2012.12 i686/x86_64 || KVM || Amsterdam ||
 
|-
 
|-
| [https://www.transip.nl/ TransIP] || 2011.08 || KVM || Amsterdam ||
+
| [https://www.transip.nl/ TransIP] || 2013.01.04 || KVM || Amsterdam ||
 
|-
 
|-
 
| [http://www.xenvz.co.uk/ XenVZ] || 2009.12 x86_64 || OpenVZ, Xen || UK? ||
 
| [http://www.xenvz.co.uk/ XenVZ] || 2009.12 x86_64 || OpenVZ, Xen || UK? ||
Line 56: Line 68:
 
| [http://www.virpus.com/ Virpus] || 2010.05 x86_64 || OpenVZ, Xen || Kansas City ||
 
| [http://www.virpus.com/ Virpus] || 2010.05 x86_64 || OpenVZ, Xen || Kansas City ||
 
|-
 
|-
| [http://vpslink.com/ VPSLink] || 0.8 || OpenVZ, Xen || Boston ||
+
| [http://www.vmline.pl/ Vmline] || 2012.08.04-dual.iso || Xen-HVM || Poland - Kraków || [http://www.s-net.pl/en/ S-Net] reseller. It's probably imposible to install i686 due to lack of xen_netfront and xen_blkfront modules ||
 +
|-
 +
| [https://vps6.net/ VPS6.NET] || 2010.05 i686/x86_64 OpenVZ, 2012.01 x86_64 Xen || OpenVZ, Xen || Germany, Romania, Turkey, USA ||
 
|-
 
|-
 
| [http://www.uk2.net/ UK2.net] || 2010.05 i686/x86_64 || Xen || United Kingdom || Appears to use a custom kernel; do not install the {{pkg|linux}} package.
 
| [http://www.uk2.net/ UK2.net] || 2010.05 i686/x86_64 || Xen || United Kingdom || Appears to use a custom kernel; do not install the {{pkg|linux}} package.
Line 68: Line 82:
  
 
===OpenVZ===
 
===OpenVZ===
{{Expansion|Move some of the [[#Troubleshooting]] instructions here.}}
+
 
 +
====Getting a 2010.05 Image Up To Date====
 +
 
 +
These instructions you have a 2010.05 image from your VPS provider and you'd like to get it up to scratch. The biggest work involves preparing /lib for the symlink upgrade (glibc 2.16, and later filesystem 2013.01).
 +
 
 +
{{Warning|If you are on a older kernel than 2.6.32, please refer [[Virtual_Private_Server#OpenVZ:_kernel_too_old_for_glibc|further down the page]] to get the glibc-vps repo working (just add the repo and you can follow these steps).}}
 +
 
 +
To start, grab the latest busybox from http://busybox.net/downloads/binaries/latest/. This allows you to force glibc (losing /lib temporarily) without losing your OS (busybox comes with its own GNU tools which are statically linked).
 +
 
 +
{{bc|wget http://busybox.net/downloads/binaries/latest/busybox-i686
 +
chmod +x busybox-i686}}
 +
 
 +
First off you can get a list of packages that own files in /lib with the following command:
 +
{{bc|<nowiki>
 +
pacman -Qo /lib/* | cut -d' ' -f 5 | egrep -v 'glibc' | uniq | xargs
 +
</nowiki>}}
 +
 
 +
For the current 2010.05 that comes straight off of ibiru's page, these are the packages that were required to be removed for me:
 +
 
 +
{{bc|pacman -S acl attr util-linux-ng bzip2 libcap e2fsprogs libgcrypt libgpg-error udev readline ncurses pam pcre popt procps readline shadow e2fsprogs sysfsutils udev util-linux-ng sysvinit coreutils}}
 +
 
 +
You may have to remove /lib/udev/devices/loop0 (a simple rm works).
 +
 
 +
After the upgrade finishes, you must remove any extra empty directories in /lib (/lib/modules is the common offender):
 +
{{bc|rm -rf /lib/modules}}
 +
 
 +
Install tzdata to fix some dependencies and remove /etc/profile.d/locale.sh:
 +
{{bc|pacman -S tzdata
 +
rm /etc/profile.d/locale.sh}}
 +
 
 +
Remove /var/run (you should have nothing running that matters):
 +
{{bc|rm -rf /var/run}}
 +
 
 +
Force glibc (this will pull in the latest filesystem, but BREAK everything (other than busybox)):
 +
{{bc|pacman -S --force glibc}}
 +
 
 +
Now you will have a broken system, so first thing symlink /usr/lib to /lib with busybox's ln:
 +
{{bc|./busybox-i686 ln -s /usr/lib /lib}}
 +
 
 +
And you should have a fully functional system where you can now update pacman.
 +
 
 +
{{bc|pacman -S pacman; pacman-key --init; pacman-key --populate archlinux; pacman-db-upgrade; pacman -Syy}}
 +
 
 +
Now, update initscripts to get iproute2:
 +
 
 +
{{bc|pacman -S iniscripts}}
 +
 
 +
Install makedev:
 +
{{bc|pacman -S makedev}}
 +
 
 +
Add the following to your /etc/rc.local:
 +
{{bc|/usr/sbin/MAKEDEV tty
 +
/usr/sbin/MAKEDEV pty}}
 +
 
 +
Comment the following lines in /etc/inittab:
 +
{{bc|#c1:2345:respawn:/sbin/agetty -8 -s 38400 tty1 linux
 +
#c2:2345:respawn:/sbin/agetty -8 -s 38400 tty2 linux
 +
#c3:2345:respawn:/sbin/agetty -8 -s 38400 tty3 linux
 +
#c4:2345:respawn:/sbin/agetty -8 -s 38400 tty4 linux
 +
#c5:2345:respawn:/sbin/agetty -8 -s 38400 tty5 linux
 +
#c6:2345:respawn:/sbin/agetty -8 -s 38400 tty6 linux}}
 +
 
 +
Finally, you should be able to upgrade the whole system:
 +
 
 +
{{bc|pacman -Su}}
 +
 
 +
You may run into some issues with krb5 and heimdal, as krb5 no longer provides+conflicts+replaces heimdal (https://projects.archlinux.org/svntogit/packages.git/commit/trunk/PKGBUILD?h=packages/krb5&id=f5e6d77fd14ced15ebf5b6a78a7c76e0db0625f7). The old openssh depends on heimdal (and the new openssh depends on krb5), so force install krb5, then upgrade openssh, then remove heimdal and reinstall krb5.
 +
 
 +
{{bc|pacman -S --force krb5
 +
pacman -S openssh openssl
 +
pacman -R heimdal
 +
pacman -S krb5}}
 +
 
 +
Fix syslog-ng (set the src to unix-dgram("/dev/log") and add --no-caps to both check and run args in /etc/conf.d/syslog-ng).
 +
 
 +
Make sure your rc.conf isn't messed up with broken network definitions, or else be sure serial access works on your VPS before you reboot.
 +
 
 +
 
 +
====Moving your VPS from network configuration in rc.conf to netcfg (tested with OpenVZ)====
 +
 
 +
1) Install netcfg
 +
 
 +
{{bc|pacman -S netcfg}}
 +
 
 +
2) Create a netcfg configuration file {{ic|/etc/network.d/venet}}
 +
 
 +
{{bc|1=CONNECTION='ethernet'
 +
DESCRIPTION='VPS venet connection'
 +
INTERFACE='venet0'
 +
IP='static'
 +
IPCFG=(
 +
#IPv4 address
 +
'addr add xxx.xxx.xxx.xxx/32 broadcast 0.0.0.0 dev venet0'
 +
#IPv4 route
 +
'route add default dev venet0'
 +
#IPv6 address
 +
'addr add xxxx:xx:xx::x/128 dev venet0'
 +
#IPv6 route
 +
'-6 route add default dev venet0'
 +
)
 +
DNS=('xxx.xxx.xxx.xxx' 'xxx.xxx.xxx.xxx')}}
 +
 
 +
3) Edit your netcfg main conf file {{ic|/etc/conf.d/netcfg}}
 +
 
 +
{{bc|1=NETWORKS=(venet)
 +
WIRED_INTERFACE="venet0"}}
 +
 
 +
4) Try your new setup
 +
 
 +
{{bc|rc.d stop network && ip addr flush venet0 && netcfg venet}}
 +
 
 +
Your VPS should still be connected and have its IP addresses set correctly. (Check with {{ic|ip a}})
 +
 
 +
DO NOT proceed to next step if this isn't the case.
 +
 
 +
5) Make your new setup survive reboots
 +
 
 +
In the {{ic|DAEMONS}} array in {{ic|/etc/rc.conf}}, replace {{ic|network}} with {{ic|net-profiles}}.
 +
 
 +
Remove all networking information that is in {{ic|/etc/rc.conf}}.
 +
{{bc|reboot}}
 +
 
 +
====Moving your VPS from initscripts to systemd====
 +
 
 +
{{Warning|This has been known to work with OpenVZ on the 2.6.32 kernel, but systemd may not work on older kernels.}}
 +
 
 +
This is very similar to a regular arch system, except you probably don't have access to your kernel line.
 +
 
 +
1) Move from network in rc.conf to netcfg (see above).
 +
 
 +
2) Install systemd
 +
 
 +
{{bc|pacman -S systemd}}
 +
 
 +
2 bonus for OpenVZ) Remove kernel core dump pattern since this is blocked by OpenVZ and causes errors
 +
 
 +
Edit {{ic|/usr/lib/sysctl.d/coredump.conf}}, comment out the following line:
 +
{{bc|#kernel.core_pattern&#61;&#124;/usr/lib/systemd/systemd-coredump %p %u %g %s %t %e}}
 +
 
 +
3) Move all configuration from {{ic|/etc/rc.conf}} (except the {{ic|DAEMONS}} array) to its appropriate location.
 +
 
 +
See [https://wiki.archlinux.org/index.php/Systemd#Native_configuration Native configuration] and [https://wiki.archlinux.org/index.php/Rc.conf rc.conf] for details.
 +
 
 +
Now your {{ic|/etc/rc.conf}} should only contain the {{ic|DAEMONS}} array.
 +
 
 +
4) Install systemd-sysvcompat
 +
 
 +
{{bc|pacman -S systemd-sysvcompat}}
 +
 
 +
It will ask to replace sysvinit, say yes.
 +
 
 +
{{bc|reboot}}
 +
 
 +
5) Move daemons from the {{ic|DAEMONS}} array in {{ic|/etc/rc.conf}} to {{ic|systemd}}
 +
 
 +
See the [https://wiki.archlinux.org/index.php/Systemd#Moving_away_from_the_DAEMONS_array guide] and the [https://wiki.archlinux.org/index.php/Daemons_List daemons list].
 +
 
 +
If your {{ic|DAEMONS}} array is now empty, skip next step.
 +
 
 +
6) Moving rc.d daemons with no systemd support, example: {{ic|vzquota}}
 +
 
 +
Create a custom systemd service file for vzquota: {{ic|/etc/systemd/system/newvzquota.service}}:
 +
{{bc|1=[Unit]
 +
Description=Setup vzquota on VPS
 +
ConditionFileIsExecutable=/etc/rc.d/vzquota
 +
 
 +
[Service]
 +
Type=oneshot
 +
ExecStart=/etc/rc.d/vzquota start
 +
ExecStop=/etc/rc.d/vzquota stop
 +
TimeoutSec=0
 +
StandardInput=tty
 +
RemainAfterExit=yes
 +
 
 +
[Install]
 +
WantedBy=multi-user.target}}
 +
 
 +
{{Note|It is recommended to choose a  .service file name that is different from the name of the daemon, because systemd might try to call the LEGACY scripts with the old name.}}
 +
 
 +
Enable this service:
 +
{{bc|systemctl enable newvzquota.service}}
 +
 
 +
Remove {{ic|vzquota}} from the {{ic|DAEMONS}} array in {{ic|/etc/rc.conf}}
 +
 
 +
Repeat this step to remove all daemons from {{ic|/etc/rc.conf}}.
 +
 
 +
7) Removing {{ic|/etc/rc.local}} and {{ic|/etc/rc.local.shutdown}}
 +
 
 +
Write [https://wiki.archlinux.org/index.php/Systemd#Writing_custom_.service_files custom .service files] to replace functionality in {{ic|/etc/rc.local}} and {{ic|/etc/rc.local.shutdown}}. You can take a look at {{ic|/usr/lib/systemd/system/rc-local.service}} and {{ic|/usr/lib/systemd/system/rc-local-shutdown.service}} for inspiration.
 +
 
 +
8) Removing {{ic|initscripts}}
 +
 
 +
Your {{ic|/etc/rc.conf}} file must look like this:
 +
{{bc|1=DAEMONS=()}}
 +
and {{ic|/etc/rc.local}} and {{ic|/etc/rc.local.shutdown}} must now be empty.
 +
 
 +
Uninstall {{ic|initscripts}}
 +
{{bc|pacman -R initscripts}}
 +
 
 +
{{bc|reboot}}
  
 
===Xen===
 
===Xen===
 
{{Expansion|Are there instructions specific to VPSes?}}
 
{{Expansion|Are there instructions specific to VPSes?}}
 
See [[Xen#Arch as Xen guest (PVHVM mode)]] and/or [[Xen#Arch as Xen guest (PV mode)]].
 
See [[Xen#Arch as Xen guest (PVHVM mode)]] and/or [[Xen#Arch as Xen guest (PV mode)]].
 +
 +
===Converting Openstack and Xen components to systemd===
 +
 +
There are three components that need to be enabled in systemd when using a VPS based on Openstack/Xen, such as Rackspace NextGen Cloud.  The current version of {{Pkg|xe-guest-utilities}} contains two of these, xe-linux-distribution and xe-daemon.
 +
 +
You will need to create a custom service file for the Openstack nova-agent, as the current version 0.0.1.37 only comes with a sysvinit startup script.
 +
 +
{{bc|cat >> /etc/systemd/system/nova-agent.service << EOF
 +
[Unit]
 +
Description&#61;Openstack nova agent
 +
After&#61;xe-daemon.service
 +
 +
[Service]
 +
Type&#61;forking
 +
ExecStart&#61;/usr/sbin/nova-agent -q -o /var/log/nova-agent.log -l info /usr/share/nova-agent/nova-agent.py
 +
 +
[Install]
 +
WantedBy&#61;multi-user.target
 +
EOF}}
 +
 +
Once these steps are done you can continue with converting the server from sysvinit to systemd.
 +
 +
{{bc|systemctl enable xe-linux-distribution.service
 +
systemctl enable xe-daemon.service
 +
systemctl enable nova-agent.service}}
  
 
==Troubleshooting==
 
==Troubleshooting==
Line 78: Line 316:
 
Are you on a virtual private server (VPS) with an old kernel & broke your system? Are you using OpenVZ?
 
Are you on a virtual private server (VPS) with an old kernel & broke your system? Are you using OpenVZ?
  
Arch Template Used: http://dev.archlinux.org/~ibiru/openvz/2010.05/arch-2010.05-i686-minimal.tar.gz
+
Check your kernel version with:
 +
 
 +
{{bc|uname -r}}
 +
 
 +
If your kernel is older than 2.6.32, you will need a custom version of glibc ([https://www.archlinux.org/news/minimum-kernel-requirement-2632/ because of dependencies in glibc]).
 +
 
 +
Arch Template Used: https://dev.archlinux.org/~ibiru/openvz/2010.05/arch-2010.05-i686-minimal.tar.gz
 +
 
 +
{{Note|for installs that have not been updated to glibc-2.16, it will save you lots of time and prevent major breakage to do:
 +
pacman -U https://dev.archlinux.org/~ibiru/openvz/glibc-vps/i686/glibc-2.16.0-101-i686.pkg.tar.xz
 +
or
 +
pacman -U https://dev.archlinux.org/~ibiru/openvz/glibc-vps/x86_64/glibc-2.16.0-101-x86_64.pkg.tar.xz
 +
Add a single "-d" if needed. ''The instructions below assume that this has been done.''
 +
}}
 +
 
 +
 
 +
Following similar instructions from [[DeveloperWiki:usrlib]].
  
 
Try doing the following to fix it:
 
Try doing the following to fix it:
Line 87: Line 341:
  
 
{{bc|<nowiki>[glibc-vps]
 
{{bc|<nowiki>[glibc-vps]
Server = http://dev.archlinux.org/~ibiru/openvz/glibc-vps/i686</nowiki>}}
+
Server = https://dev.archlinux.org/~ibiru/openvz/glibc-vps/i686</nowiki>}}
  
 
for 64-bit:
 
for 64-bit:
  
 
{{bc|<nowiki>[glibc-vps]
 
{{bc|<nowiki>[glibc-vps]
Server = http://dev.archlinux.org/~ibiru/openvz/glibc-vps/x86_64</nowiki>}}
+
Server = https://dev.archlinux.org/~ibiru/openvz/glibc-vps/x86_64</nowiki>}}
  
 
2) Then run {{ic|pacman -Syy}} followed by {{ic|pacman -Syu}}. You will be notified to upgrade pacman first.
 
2) Then run {{ic|pacman -Syy}} followed by {{ic|pacman -Syu}}. You will be notified to upgrade pacman first.
Line 101: Line 355:
  
 
{{bc|<nowiki>[glibc-vps]
 
{{bc|<nowiki>[glibc-vps]
Server = http://dev.archlinux.org/~ibiru/openvz/glibc-vps/$arch</nowiki>}}
+
Server = https://dev.archlinux.org/~ibiru/openvz/glibc-vps/$arch</nowiki>}}
  
 
5) Replace {{ic|/etc/pacman.conf}} with {{ic|/etc/pacman.conf.pacnew}} (run as root):
 
5) Replace {{ic|/etc/pacman.conf}} with {{ic|/etc/pacman.conf.pacnew}} (run as root):
Line 144: Line 398:
 
10) To enable the use of the {{ic|hostname}} command, [[pacman|install]] the package {{Pkg|inetutils}} from the [[Official Repositories|official repositories]].  
 
10) To enable the use of the {{ic|hostname}} command, [[pacman|install]] the package {{Pkg|inetutils}} from the [[Official Repositories|official repositories]].  
  
11) Save and reboot.
+
11) Remove disabling of SysRq key and setup of core dump pattern since this is blocked by OpenVZ and causes errors
 +
 
 +
Edit {{ic|/etc/sysctl.conf}}, comment out the following line:
 +
{{bc|1=#kernel.sysrq = 0}}
 +
 
 +
Edit {{ic|/usr/lib/sysctl.d/coredump.conf}}, comment out the following line:
 +
{{bc|1=#kernel.core_pattern=&#124;/usr/lib/systemd/systemd-coredump %p %u %g %s %t %e}}
 +
 
 +
12) Save and reboot.
  
 
Enjoy & thank ioni if you happen to be in #archlinux
 
Enjoy & thank ioni if you happen to be in #archlinux

Revision as of 16:59, 18 May 2013

Summary help replacing me
This article discusses the use of Arch Linux on Virtual Private Servers, and includes some fixes and installation instructions specific to VPSes.
Related
Comprehensive Server Guide

From Wikipedia:Virtual private server:

Virtual private server (VPS) is a term used by Internet hosting services to refer to a virtual machine. The term is used for emphasizing that the virtual machine, although running in software on the same physical computer as other customers' virtual machines, is in many respects functionally equivalent to a separate physical computer, is dedicated to the individual customer's needs, has the privacy of a separate physical computer, and can be configured to run server software.

Providers that offer Arch Linux

Warning: We cannot vouch for the honesty or quality of any provider. Please conduct due diligence before ordering.
Note: This list is for providers with a convenient Arch Linux image. Using Arch on other providers is probably possible, but would require loading custom ISOs or disk images or installing under chroot.
Provider Arch Release Virtualization Locations Notes
123 Systems 2010.05 i686/x86_64 OpenVZ Dallas, TX Arch available as a selection upon reinstall. Very old (2.6.18-308) kernel - See OpenVZ troubleshooting.
Afterburst 2012.12.01 i686/x86_64 OpenVZ Miami (USA), Falkenstein (Germany) Formerly FanaticalVPS, kernel version depends on what node your VPS is on, the ones in Miami are fine (2.6.32-042stab072.10) but some of the ones in Germany require a custom glibc.
AlienVPS 2010.05 Xen, KVM Los Angeles, New York
Clodo.ru 2011.?? Xen Moscow Can pay per hour. Lists an invalid release version of the installer.
Edis 2013.03.01 i686/x86_64 vServer, KVM Austria, Chile, Germany, France, Hong Kong, Italy, Iceland, Poland, Sweden, Switzerland, Spain, UK, USA
EOReality (?) i686/x86_64 OpenVZ Chicago Need to use special glibc-vps repo for this provider . See OpenVZ troubleshooting for instructions. You will also need to remove heimdal.
DirectVPS 2012.09 x86_64 Xen Amsterdam, Rotterdam
Generation-Host 2012.07 Xen Chicago IL, Clifton NJ and Toronto ON Canada
GigaTux 2011.08 x86_64 Xen Chicago, Frankfurt, Israel, London, San Jose
Host Virtual 2011.08 Xen Amsterdam, Chennai (Madras), Chicago, Dallas, Hong Kong, London, Los Angeles, New York, Paris, Reston, San Jose
Hostigation 2010.05 i686 OpenVZ, KVM Charlotte, Los Angeles You can migrate to x86_64.
IntoVPS 2012.05 i686/x86_64 OpenVZ Amsterdam, Bucharest, Dallas, Fremont, London
Linode.com 2012.07 Xen Atlanta, Dallas, Fremont, London, Newark, Tokyo Uses a custom kernel; do not install the linux package.
Lylix 2007.08  ?  ?
Node Deploy  ? OpenVZ, KVM LA, Germany unmanaged, solusvm server manager
Netcup 2011.10 x86_64/2012.11 x86_64 vServer, KVM Germany
OnePoundWebHosting 2012.09 x86_64 Xen UK
OpenVZ.ca 2010.05 i686/x86_64 OpenVZ Canada
proPlay.de 2011.10 i686/x86_64 OpenVZ, KVM Germany
Rackspace Cloud 2013.2 Xen Chicago, Dallas, London Billed per hour.
RamHost.us 2012.12 OpenVZ, KVM Atlanta, England, Germany, Los Angeles You can request a newer iso on IRC.
Tilaa 2012.12 i686/x86_64 KVM Amsterdam
TransIP 2013.01.04 KVM Amsterdam
XenVZ 2009.12 x86_64 OpenVZ, Xen UK?
Virpus 2010.05 x86_64 OpenVZ, Xen Kansas City
Vmline 2012.08.04-dual.iso Xen-HVM Poland - Kraków S-Net reseller. It's probably imposible to install i686 due to lack of xen_netfront and xen_blkfront modules
VPS6.NET 2010.05 i686/x86_64 OpenVZ, 2012.01 x86_64 Xen OpenVZ, Xen Germany, Romania, Turkey, USA
UK2.net 2010.05 i686/x86_64 Xen United Kingdom Appears to use a custom kernel; do not install the linux package.

Installation

KVM

Tango-view-fullscreen.pngThis article or section needs expansion.Tango-view-fullscreen.png

Reason: Are there instructions specific to VPSes? (Discuss in Talk:Virtual Private Server#)

See KVM#Preparing an (Arch) Linux guest.

OpenVZ

Getting a 2010.05 Image Up To Date

These instructions you have a 2010.05 image from your VPS provider and you'd like to get it up to scratch. The biggest work involves preparing /lib for the symlink upgrade (glibc 2.16, and later filesystem 2013.01).

Warning: If you are on a older kernel than 2.6.32, please refer further down the page to get the glibc-vps repo working (just add the repo and you can follow these steps).

To start, grab the latest busybox from http://busybox.net/downloads/binaries/latest/. This allows you to force glibc (losing /lib temporarily) without losing your OS (busybox comes with its own GNU tools which are statically linked).

wget http://busybox.net/downloads/binaries/latest/busybox-i686
chmod +x busybox-i686

First off you can get a list of packages that own files in /lib with the following command:

pacman -Qo /lib/* | cut -d' ' -f 5 | egrep -v 'glibc' | uniq | xargs

For the current 2010.05 that comes straight off of ibiru's page, these are the packages that were required to be removed for me:

pacman -S acl attr util-linux-ng bzip2 libcap e2fsprogs libgcrypt libgpg-error udev readline ncurses pam pcre popt procps readline shadow e2fsprogs sysfsutils udev util-linux-ng sysvinit coreutils

You may have to remove /lib/udev/devices/loop0 (a simple rm works).

After the upgrade finishes, you must remove any extra empty directories in /lib (/lib/modules is the common offender):

rm -rf /lib/modules

Install tzdata to fix some dependencies and remove /etc/profile.d/locale.sh:

pacman -S tzdata
rm /etc/profile.d/locale.sh

Remove /var/run (you should have nothing running that matters):

rm -rf /var/run

Force glibc (this will pull in the latest filesystem, but BREAK everything (other than busybox)):

pacman -S --force glibc

Now you will have a broken system, so first thing symlink /usr/lib to /lib with busybox's ln:

./busybox-i686 ln -s /usr/lib /lib

And you should have a fully functional system where you can now update pacman.

pacman -S pacman; pacman-key --init; pacman-key --populate archlinux; pacman-db-upgrade; pacman -Syy

Now, update initscripts to get iproute2:

pacman -S iniscripts

Install makedev:

pacman -S makedev

Add the following to your /etc/rc.local:

/usr/sbin/MAKEDEV tty
/usr/sbin/MAKEDEV pty

Comment the following lines in /etc/inittab:

#c1:2345:respawn:/sbin/agetty -8 -s 38400 tty1 linux
#c2:2345:respawn:/sbin/agetty -8 -s 38400 tty2 linux
#c3:2345:respawn:/sbin/agetty -8 -s 38400 tty3 linux
#c4:2345:respawn:/sbin/agetty -8 -s 38400 tty4 linux
#c5:2345:respawn:/sbin/agetty -8 -s 38400 tty5 linux
#c6:2345:respawn:/sbin/agetty -8 -s 38400 tty6 linux

Finally, you should be able to upgrade the whole system:

pacman -Su

You may run into some issues with krb5 and heimdal, as krb5 no longer provides+conflicts+replaces heimdal (https://projects.archlinux.org/svntogit/packages.git/commit/trunk/PKGBUILD?h=packages/krb5&id=f5e6d77fd14ced15ebf5b6a78a7c76e0db0625f7). The old openssh depends on heimdal (and the new openssh depends on krb5), so force install krb5, then upgrade openssh, then remove heimdal and reinstall krb5.

pacman -S --force krb5
pacman -S openssh openssl
pacman -R heimdal
pacman -S krb5

Fix syslog-ng (set the src to unix-dgram("/dev/log") and add --no-caps to both check and run args in /etc/conf.d/syslog-ng).

Make sure your rc.conf isn't messed up with broken network definitions, or else be sure serial access works on your VPS before you reboot.


Moving your VPS from network configuration in rc.conf to netcfg (tested with OpenVZ)

1) Install netcfg

pacman -S netcfg

2) Create a netcfg configuration file /etc/network.d/venet

CONNECTION='ethernet'
DESCRIPTION='VPS venet connection'
INTERFACE='venet0'
IP='static'
IPCFG=(
#IPv4 address
'addr add xxx.xxx.xxx.xxx/32 broadcast 0.0.0.0 dev venet0'
#IPv4 route
'route add default dev venet0'
#IPv6 address
'addr add xxxx:xx:xx::x/128 dev venet0'
#IPv6 route
'-6 route add default dev venet0'
)
DNS=('xxx.xxx.xxx.xxx' 'xxx.xxx.xxx.xxx')

3) Edit your netcfg main conf file /etc/conf.d/netcfg

NETWORKS=(venet)
WIRED_INTERFACE="venet0"

4) Try your new setup

rc.d stop network && ip addr flush venet0 && netcfg venet

Your VPS should still be connected and have its IP addresses set correctly. (Check with ip a)

DO NOT proceed to next step if this isn't the case.

5) Make your new setup survive reboots

In the DAEMONS array in /etc/rc.conf, replace network with net-profiles.

Remove all networking information that is in /etc/rc.conf.

reboot

Moving your VPS from initscripts to systemd

Warning: This has been known to work with OpenVZ on the 2.6.32 kernel, but systemd may not work on older kernels.

This is very similar to a regular arch system, except you probably don't have access to your kernel line.

1) Move from network in rc.conf to netcfg (see above).

2) Install systemd

pacman -S systemd

2 bonus for OpenVZ) Remove kernel core dump pattern since this is blocked by OpenVZ and causes errors

Edit /usr/lib/sysctl.d/coredump.conf, comment out the following line:

#kernel.core_pattern=|/usr/lib/systemd/systemd-coredump %p %u %g %s %t %e

3) Move all configuration from /etc/rc.conf (except the DAEMONS array) to its appropriate location.

See Native configuration and rc.conf for details.

Now your /etc/rc.conf should only contain the DAEMONS array.

4) Install systemd-sysvcompat

pacman -S systemd-sysvcompat

It will ask to replace sysvinit, say yes.

reboot

5) Move daemons from the DAEMONS array in /etc/rc.conf to systemd

See the guide and the daemons list.

If your DAEMONS array is now empty, skip next step.

6) Moving rc.d daemons with no systemd support, example: vzquota

Create a custom systemd service file for vzquota: /etc/systemd/system/newvzquota.service:

[Unit]
Description=Setup vzquota on VPS
ConditionFileIsExecutable=/etc/rc.d/vzquota

[Service]
Type=oneshot
ExecStart=/etc/rc.d/vzquota start
ExecStop=/etc/rc.d/vzquota stop
TimeoutSec=0
StandardInput=tty
RemainAfterExit=yes

[Install]
WantedBy=multi-user.target
Note: It is recommended to choose a .service file name that is different from the name of the daemon, because systemd might try to call the LEGACY scripts with the old name.

Enable this service:

systemctl enable newvzquota.service

Remove vzquota from the DAEMONS array in /etc/rc.conf

Repeat this step to remove all daemons from /etc/rc.conf.

7) Removing /etc/rc.local and /etc/rc.local.shutdown

Write custom .service files to replace functionality in /etc/rc.local and /etc/rc.local.shutdown. You can take a look at /usr/lib/systemd/system/rc-local.service and /usr/lib/systemd/system/rc-local-shutdown.service for inspiration.

8) Removing initscripts

Your /etc/rc.conf file must look like this:

DAEMONS=()

and /etc/rc.local and /etc/rc.local.shutdown must now be empty.

Uninstall initscripts

pacman -R initscripts
reboot

Xen

Tango-view-fullscreen.pngThis article or section needs expansion.Tango-view-fullscreen.png

Reason: Are there instructions specific to VPSes? (Discuss in Talk:Virtual Private Server#)

See Xen#Arch as Xen guest (PVHVM mode) and/or Xen#Arch as Xen guest (PV mode).

Converting Openstack and Xen components to systemd

There are three components that need to be enabled in systemd when using a VPS based on Openstack/Xen, such as Rackspace NextGen Cloud. The current version of xe-guest-utilities contains two of these, xe-linux-distribution and xe-daemon.

You will need to create a custom service file for the Openstack nova-agent, as the current version 0.0.1.37 only comes with a sysvinit startup script.

cat >> /etc/systemd/system/nova-agent.service << EOF
[Unit]
Description=Openstack nova agent
After=xe-daemon.service

[Service]
Type=forking
ExecStart=/usr/sbin/nova-agent -q -o /var/log/nova-agent.log -l info /usr/share/nova-agent/nova-agent.py

[Install]
WantedBy=multi-user.target
EOF

Once these steps are done you can continue with converting the server from sysvinit to systemd.

systemctl enable xe-linux-distribution.service 
systemctl enable xe-daemon.service
systemctl enable nova-agent.service

Troubleshooting

OpenVZ: kernel too old for glibc

Are you on a virtual private server (VPS) with an old kernel & broke your system? Are you using OpenVZ?

Check your kernel version with:

uname -r

If your kernel is older than 2.6.32, you will need a custom version of glibc (because of dependencies in glibc).

Arch Template Used: https://dev.archlinux.org/~ibiru/openvz/2010.05/arch-2010.05-i686-minimal.tar.gz

Note: for installs that have not been updated to glibc-2.16, it will save you lots of time and prevent major breakage to do:
pacman -U https://dev.archlinux.org/~ibiru/openvz/glibc-vps/i686/glibc-2.16.0-101-i686.pkg.tar.xz

or

pacman -U https://dev.archlinux.org/~ibiru/openvz/glibc-vps/x86_64/glibc-2.16.0-101-x86_64.pkg.tar.xz

Add a single "-d" if needed. The instructions below assume that this has been done.


Following similar instructions from DeveloperWiki:usrlib.

Try doing the following to fix it:

1) Edit /etc/pacman.conf and add the following repository ABOVE [core]:

for 32-bit:

[glibc-vps]
Server = https://dev.archlinux.org/~ibiru/openvz/glibc-vps/i686

for 64-bit:

[glibc-vps]
Server = https://dev.archlinux.org/~ibiru/openvz/glibc-vps/x86_64

2) Then run pacman -Syy followed by pacman -Syu. You will be notified to upgrade pacman first.

3) Upgrade the pacman database by running pacman-db-upgrade as root.

4) Edit /etc/pacman.conf.pacnew (new pacman config file) and add the following repository ABOVE [core]:

[glibc-vps]
Server = https://dev.archlinux.org/~ibiru/openvz/glibc-vps/$arch

5) Replace /etc/pacman.conf with /etc/pacman.conf.pacnew (run as root):

mv /etc/pacman.conf.pacnew /etc/pacman.conf

6) Upgrade your whole system with new packages again pacman -Syu

If you get the following or similar error:

initscripts: /etc/profile.d/locale.sh exists in filesystem

Simply delete that file (e.g., rm -f /etc/profile.d/locale.sh), then run pacman -Syu again.


If you get the following or similar error:

filesystem: /etc/mtab exists in filesystem

Run pacman -S filesystem --force


If you get the following or similar error:

libusb-compat: /usr/bin/libusb-config exists in filesystem

Run pacman -S libusb and then pacman -S libusb-compat

7) Before rebooting, you need to install the makedev package by running pacman -S makedev.

8) Add MAKEDEV to /etc/rc.local:

/usr/sbin/MAKEDEV tty
/usr/sbin/MAKEDEV pty

9) Edit /etc/inittab, comment out the following lines (otherwise you will see errors in /var/log/errors.log):

#c1:2345:respawn:/sbin/agetty -8 -s 38400 tty1 linux
#c2:2345:respawn:/sbin/agetty -8 -s 38400 tty2 linux
#c3:2345:respawn:/sbin/agetty -8 -s 38400 tty3 linux
#c4:2345:respawn:/sbin/agetty -8 -s 38400 tty4 linux
#c5:2345:respawn:/sbin/agetty -8 -s 38400 tty5 linux
#c6:2345:respawn:/sbin/agetty -8 -s 38400 tty6 linux

10) To enable the use of the hostname command, install the package inetutils from the official repositories.

11) Remove disabling of SysRq key and setup of core dump pattern since this is blocked by OpenVZ and causes errors

Edit /etc/sysctl.conf, comment out the following line:

#kernel.sysrq = 0

Edit /usr/lib/sysctl.d/coredump.conf, comment out the following line:

#kernel.core_pattern=|/usr/lib/systemd/systemd-coredump %p %u %g %s %t %e

12) Save and reboot.

Enjoy & thank ioni if you happen to be in #archlinux

SSH fails: PTY allocation request failed on channel 0

Some VPSes have an outdated rc.sysinit. You may be able to login via serial console or with

> ssh root@broken.server '/bin/bash -i'

Then run the following:

# mv /etc/rc.sysinit.pacnew /etc/rc.sysinit
# reboot

Once it’s working, you should be able to comment out the udevd_modprobe line in rc.sysinit to save a bit of RAM the next time you reboot.

If the above doesn’t work, take a look at http://fsk141.com/fix-pty-allocation-request-failed-on-channel-0.