Difference between revisions of "Virtual Private Server"

From ArchWiki
Jump to: navigation, search
m (update afterburst vps release info for arch)
m (Added RoseHosting to the list)
 
(159 intermediate revisions by 55 users not shown)
Line 1: Line 1:
 
[[Category:Getting and installing Arch]]
 
[[Category:Getting and installing Arch]]
 
[[Category:Virtualization]]
 
[[Category:Virtualization]]
{{Article summary start}}
+
[[ja:Virtual Private Server]]
{{Article summary text|This article discusses the use of Arch Linux on Virtual Private Servers, and includes some fixes and installation instructions specific to VPSes.}}
+
[[zh-CN:Virtual Private Server]]
{{Article summary heading|Related}}
+
{{Related articles start}}
{{Article summary wiki|Comprehensive Server Guide}}
+
{{Related|Server}}
{{Article summary end}}
+
{{Related articles end}}
 
From [[Wikipedia:Virtual private server]]:
 
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.''
 
:''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.''
 +
 +
This article discusses the use of Arch Linux on Virtual Private Servers, and includes some fixes and installation instructions specific to VPSes.
 +
 +
{{Warning|
 +
* Linux 2.6.32 is not supported by systemd since version 205 (and will not work with systemd-212 or higher). Since many container-based virtualization environments rely on older kernels, it may be impossible to keep an Arch Linux install up-to-date in such an environment.  However, OpenVZ, as of [http://openvz.org/Download/kernel/rhel6/042stab094.7 kernel build 042stab094.7], has backported the CLOCK_BOOTTIME feature, making it work with later versions of systemd.
 +
* Systemd since version 220 doesn't work on OpenVZ containers. [https://github.com/systemd/systemd/issues/421]  This issue has been fixed in OpenVZ kernel 042stab111.1 [https://bugzilla.openvz.org/show_bug.cgi?id=3280#c11]}}
  
 
==Providers that offer Arch Linux==
 
==Providers that offer Arch Linux==
  
 
{{Warning|We cannot vouch for the honesty or quality of any provider. Please conduct due diligence before ordering.}}
 
{{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 [[Installation Chroot|installing under chroot]].}}
+
{{Note|This list is for providers with a convenient Arch Linux template. Using Arch on other providers is possible but requires more work.  Example methods include:
 +
* Loading custom disc images (requires hardware virtualization such as in Xen or KVM),
 +
* [[Installation guide|Installing under chroot]], for example with the help of the [https://github.com/drizzt/vps2arch vps2arch] script (it will download the latest iso; be particularly aware of the  systemd 220/221 [https://github.com/systemd/systemd/issues/421 bug]), or
 +
* Following [[#Installing the latest Arch Linux on any OpenVZ provider]] instructions, using rsync to synchronize Arch over the top of another distribution.}}
  
{| border="1"
+
{| class="wikitable"
 
! 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://www.milesweb.com/vps-hosting.php A MilesWeb VPS] || 2013.10.14 || OpenVZ || Europe, India, US || Latest Arch Linux available on OpenVZ platform. Quick setup, 24/7 support via Live Chat, Email and Phone. VPS starts from $20 / mo
 
|-
 
|-
| [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://123systems.net 123 Systems] || 2010.05.xx || OpenVZ || Dallas, US-TX || Arch available as a selection upon reinstall. Very old (2.6.18-308) kernel - See [[#OpenVZ: kernel too old for glibc|OpenVZ troubleshooting]]. Limited information available before purchase. Cannot verify Arch Linux version without purchase.
 
|-
 
|-
| [http://alienvps.com/ AlienVPS] || 2010.05 || Xen, KVM || Los Angeles, New York ||
+
| [http://www.4smart.cz 4smart.cz] || 2013.08 (x86_64) || OpenVZ || Europe, Prague || when updating system make sure you use [tredaelli-systemd] in pacman.conf (see [[Unofficial user repositories]]
 
|-
 
|-
| [https://www.clodo.ru/ Clodo.ru] || 2011.?? || Xen || Moscow || Can pay per hour. Lists an invalid release version of the installer.
+
| [http://ausweb.com.au AUSWEB] || Latest Only (clarify?) || VMware ESXi || Sydney, AU || Latest ISO (clarify?) of Arch Available. Enterprise Service.  
 
|-
 
|-
| [http://en.edis.at/ Edis] || 2011.08 i686/x86_64 || vServer, KVM || Austria, Chile, Germany, France, Hong Kong, Italy, Iceland, Poland, Sweden, Switzerland, Spain, UK, USA ||
+
| [https://www.affinity.net.nz affinity.net.nz] || 2013.08.01 || KVM || Auckland, New Zealand (NZ) || IRC channel is #affinity on ircs.kiwicon.org
 
|-
 
|-
| [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://www.atlantic.net/ Atlantic.Net] || 2015.05.01 || KVM || NYC/SF/Toronto/Dallas/Orlando, US & Canada || 100% SSD 1-click ArchLinux from $5/mo for 512M/20GB SSD, ready in 30 seconds
 
|-
 
|-
| [https://www.directvps.nl/ DirectVPS] || 2012.09 x86_64 || Xen || Amsterdam, Rotterdam ||  
+
| [http://www.buyvm.net/ BuyVM] || 2013.07.01 || KVM || LA, Buffalo NY || Must chose a different OS at sign up.  Once accessible, choose to mount the latest Arch ISO and reboot to install manually.
 
|-
 
|-
| [http://generation-host.com Generation-Host] || 2012.07 || Xen || Chicago IL, Clifton NJ and Toronto ON Canada ||
+
| [https://coinshost.com/en/vps Coinshost] || 2015.04 || Xen || Zurich, Switzerland || $3/mo for 512M/20GB.  Bitcoin and other cryptocurrencies accepted.
 
|-
 
|-
| [https://www.gigatux.com/virtual.php GigaTux] || 2011.08 x86_64 || Xen || Chicago, Frankfurt, Israel, London, San Jose ||
+
| [https://www.directvps.nl/ DirectVPS] || 2014.01.xx || OpenVZ || Amsterdam, NL; Rotterdam, NL || Dutch language site. Version verifyable by clicking through https://www.directvps.nl/try-1.plp?p=31
 
|-
 
|-
| [http://www.vr.org/ Host Virtual] || 2011.08 || Xen || Amsterdam, Chennai (Madras), Chicago, Dallas, Hong Kong, London, Los Angeles, New York, Paris, Reston, San Jose ||
+
| [http://en.edis.at/ Edis] || [http://www.edis.at/en/support-and-service/faq/server-faq/which-distributions-are-available-with-edis-kvm-vps-plans/ 2013.03.01] || vServer, KVM, OpenVZ || [http://www.edis.at/en/server/kvm-vps/austria/ Multiple international locations]. || Also offer dedicated server options as well as an "off-shore" location at the Isle of Man (IM).
 
|-
 
|-
| [https://hostigation.com/ Hostigation] || 2010.05 i686 || OpenVZ, KVM || Charlotte, Los Angeles || You can [[Migrating Between Architectures Without Reinstalling|migrate to x86_64]].
+
| [https://www.gandi.net/hosting/ Gandi] || 2013.10.27 || Xen || Paris, FR; Baltimore, MD, US; Bissen, LU || Very granular scaling of system resources (e.g. RAM, disk space); IPv6-only option available; you can supply your own install image, version based on keyring package version ||
 
|-
 
|-
| [http://www.intovps.com IntoVPS] || 2012.05 i686/x86_64 || OpenVZ || Amsterdam, Bucharest, Dallas, Fremont, London ||
+
| [https://www.gigatux.com/virtual.php GigaTux] || [https://www.gigatux.com/distro/ 2013.06.01] || Xen || Chicago, US-IL; Frankfurt, DE; London, GB; San Jose, US-CA ||
 
|-
 
|-
| [https://www.linode.com Linode.com] || 2012.07 || Xen || Atlanta, Dallas, Fremont, London, Newark, Tokyo || Uses a custom kernel; do not install the {{pkg|linux}} package.
+
| [http://www.vr.org/ Host Virtual] || [http://www.vr.org/os/linux-vps/archlinux-vps 2011.08.19] || KVM || [http://www.vr.org/cloud-locations/ Multiple International Locations] || Appears to use KVM virtualization. Site lists "Xen based virtualization" and [http://www.vr.org/features/ features] lists ability to install from ISO.
 
|-
 
|-
| [http://lylix.net/home Lylix] || 2007.08 || ? || ? ||
+
| [https://hostigation.com/ Hostigation] || [https://hostigation.com/wiki/index.php?title=KVM:Install 2010.05 i686] || OpenVZ, KVM || Charlotte, US-NC; Los Angeles, US-CA || You can [[Migrating Between Architectures Without Reinstalling|migrate to x86_64]].
 
|-
 
|-
| [http://www.nodedeploy.com Node Deploy] || ? || OpenVZ, KVM || LA, Germany || unmanaged, solusvm server manager
+
| [http://www.intovps.com IntoVPS] || 2012.09.xx || OpenVZ || Amsterdam, NL; Bucharest, RO; Dallas, US-TX; Fremont, US-CA; London, GB || Blog has not been updated since September, 2012 which included the Arch Linux update.
 
|-
 
|-
| [http://netcup.de Netcup] || 2011.10 x86_64/2012.11 x86_64 || vServer, KVM || Germany ||  
+
| [https://www.kloud51.com Kloud51] || 2014.7.7 || OpenVZ || US-CA, Canada || SSD, 2 images available:  A bare-bones system or a pre-configured Desktop with OpenBox, XRDP, Firefox, SSH Brute Force, Geany, and Yaourt.
 
|-
 
|-
| [http://onepoundwebhosting.co.uk OnePoundWebHosting] || 2012.09 x86_64 || Xen || UK ||
+
| [https://leapswitch.com Leapswitch Networks] || [2013.10.xx] || OpenVZ/KVM || USA, India, Portugal, Spain, Ukraine, Germany || ArchLinux currently available in Control Panel for reinstall, not on order form.
 
|-
 
|-
| [http://openvz.ca/ OpenVZ.ca] || 2010.05 i686/x86_64 || OpenVZ || Canada ||
+
| [https://www.linode.com Linode.com] || [https://www.linode.com/faq.cfm 2015.02.xx] || Xen, KVM || [https://www.linode.com/speedtest/ Tokyo, JP; Multiple US; London, GB] || To run a custom kernel, install {{AUR|linux-linode}}. ({{pkg|linux}} will break on a 32-bit Linode.)
 
|-
 
|-
| [https://www.proplay.biz/ proPlay.de] || 2011.10 i686/x86_64 || OpenVZ, KVM || Germany ||
+
| [http://lylix.net/ LYLIX] || [http://lylix.net/archlinux 2014.01.xx] || OpenVZ || Multiple US; Europe || 32-bit and 64-bit available
 
|-
 
|-
| [http://www.rackspace.com/cloud/cloud_hosting_products/servers/ Rackspace Cloud] || 2012.08 || Xen || Chicago, Dallas, London || Billed per hour.
+
| [http://www.nodedeploy.com Node Deploy] || 2014.10.01 || OpenVZ, KVM || Germany (DE); Los Angeles, US-CA; Atlanta, US-GA; Phoenix, US-AZ || "At NodeDeploy we support virtually every linux distribution." Arch Linux is listed under their Operating Systems. No version information.
 
|-
 
|-
| [http://www.ramhost.us RamHost.us] || 2012.12 || OpenVZ, KVM || Atlanta, England, Germany, Los Angeles || You can request a newer iso on IRC. ||
+
| [http://netcup.de Netcup] || 2012.11.xx || KVM || Germany (DE)|| German language site.  
 
|-
 
|-
| [http://www.tilaa.nl/ Tilaa] || 2012.12 i686/x86_64 || KVM || Amsterdam ||
+
| [http://onepoundwebhosting.co.uk OnePoundWebHosting] || 2013.05.xx || Xen PV, Xen HVM || United Kingdom (UK) || They are a registrar too. Unable to verify server locations.
 
|-
 
|-
| [https://www.transip.nl/ TransIP] || 2013.01.04 || KVM || Amsterdam ||
+
| [https://www.ovh.com/us/vps/ OVH] || Latest || KVM || France, Canada || $3.5 for 2GB RAM and 10GB SSD, $7 for 4GB RAM and 20GB SSD.
 
|-
 
|-
| [http://www.xenvz.co.uk/ XenVZ] || 2009.12 x86_64 || OpenVZ, Xen || UK? ||
+
| [https://www.proplay.biz/ proPlay.de] || 2012.12.xx || OpenVZ, KVM || Germany (DE) || German language site.
 
|-
 
|-
| [http://www.virpus.com/ Virpus] || 2010.05 x86_64 || OpenVZ, Xen || Kansas City ||
+
| [https://www.quickvz.com QuickVZ] || 2013.10 || OpenVZ, Xen || Amsterdam, Netherlands (NL); Stockholm, Sweden (SE) || Provide hardened Arch Linux images along with Enterprise services (e,g. VPN, Virtual Private LAN Service (VPLS) and Virtual Routers.
 
|-
 
|-
| [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 ||
+
| [http://www.rackspace.com/cloud/cloud_hosting_products/servers/ Rackspace Cloud] || 2013.6 || Xen || [https://www.rackspace.com/whyrackspace/network/datacenters/ Multiple international locations] || Billed per hour. Use their "next gen" VPSes (using the mycloud.rackspace.com panel); the Arch image on the first gen Rackspace VPSes is out of date.
 
|-
 
|-
| [https://vps6.net/ VPS6.NET] || 2010.05 i686/x86_64 OpenVZ, 2012.01 x86_64 Xen || OpenVZ, Xen || Germany, Romania, Turkey, USA ||
+
| [http://www.ramhost.us RamHost.us] || [http://www.ramhost.us/?page=news 2013.05.01] || OpenVZ, KVM || Los Angeles, US-CA; Great Britain (GB); Atlanta, US-GA; Germany (DE) || You can request a newer ISO on RamHost's IRC network.
 +
|-
 +
| [http://www.ramnode.com RamNode]  || [https://clientarea.ramnode.com/knowledgebase.php?action=displayarticle&id=48 2016.01.01] || [https://clientarea.ramnode.com/knowledgebase.php?action=displayarticle&id=39 SSD and SSD Cached:] [https://clientarea.ramnode.com/knowledgebase.php?action=displayarticle&id=52 KVM] || [https://clientarea.ramnode.com/knowledgebase.php?action=displayarticle&id=50 Alblasserdam, NL; Atlanta, GA-US; Los Angeles, CA-US; New York, NY-US; Seattle, WA-US] ||  You can request Host/CPU passthrough with KVM service.[https://clientarea.ramnode.com/knowledgebase.php?action=displayarticle&id=66] Frequent use of discount promotions.[https://twitter.com/search?q=ramnode%20code&src=typd], Must install Arch manually from an ISO using VNC viewer.
 +
|-
 +
| [https://www.rosehosting.com RoseHosting] || Latest || OpenVZ, KVM || St. Louis, Missouri, USA || SSD powered hosting plans with free fully-managed 24/7 support
 +
|-
 +
| [http://www.tilaa.nl/ Tilaa] || 2014.10.01 || [https://www.tilaa.com/pages/vps/technology KVM] || Amsterdam, NL || English or Dutch language site.
 +
|-
 +
| [https://www.transip.eu/ TransIP] || [https://www.transip.eu/vps/vps-os/ 2016.02.01] || [https://www.transip.eu/vps/vps-technology/ KVM] || Amsterdam, NL || English language site. Registrar.
 +
|-
 +
| [http://www.xenvz.co.uk/ XenVZ] || 2009.12.07 || OpenVZ, Xen || United Kingdom (UK), United States (US) || [http://www.xenvz.co.uk/faq.php#use2 Hardware]
 +
|-
 +
| [http://www.virpus.com/ Virpus] || [http://virpus.com/linux-vps.php 2014.11.07] || Xen || Kansas City, US-KS; Los Angeles, US-CA || A subcompany of Wow Technologies, Inc.  24/7 support via Live Chat, Email, Phone, and Ticket System.  Service starts at $5/month.
 +
|-
 +
| [http://www.virtualmaster.com/ Virtual Master] || 2012-08 || ?? || Europe, Prague || ||
 +
|-
 +
| [http://www.vmline.pl/ Vmline] || 2013.09.01 || KVM, OpenVZ || Kraków, PL || [http://www.s-net.pl/en/ S-Net] reseller. Full virtualization. Polish language site.
 +
|-
 +
| [https://vpsbg.eu/ VPSBG.eu] || 2013.10 || OpenVZ || [https://vpsbg.eu/en/index.php?page=vps-datacenter Sofia, Bulgaria] || Offshore VPS in Bulgaria - anonymous registrations and Bitcoin are accepted.
 +
|-
 +
| [https://vps6.net/ VPS6.NET] || 2013.01.xx || OpenVZ, Xen, HVM-ISO || [http://vps6.net/network/ Multiple US]; Frankfurt, DE; Bucharest, RO; Istanbul, TR || Registrar.
 +
|-
 +
| [http://www.vps.net/ VPS.NET] || 2014.01.xx || OpenVZ, Xen, HVM-ISO || [http://vps.net/cloud-datacenter-locations US, Canada, UK, Brazil, Netherlands, France, Germany, Japan, Singapore, India, Austrlia]; Multiple || Managed & Un managed VPS service provider, multiple OS and configurations..
 +
|-
 +
| [http://www.world4you.com/ World4You] || 2015.10.28 || OpenVZ || Austria (AT) || Internet hosting provider; quick setup; 24/7 support; shared web hosting; also CentOS, Debian, Ubuntu, Fedora and Arch OpenVZ servers; supports newest systemd (227 atm)
 
|-
 
|-
| [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 79: Line 111:
 
===KVM===
 
===KVM===
 
{{Expansion|Are there instructions specific to VPSes?}}
 
{{Expansion|Are there instructions specific to VPSes?}}
See [[KVM#Preparing an (Arch) Linux guest]].
+
See [[QEMU#Preparing an (Arch) Linux guest]].
  
 
===OpenVZ===
 
===OpenVZ===
  
====Getting a 2010.05 Image Up To Date====
+
====Installing the latest Arch Linux on any OpenVZ provider====
  
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|See the [[#top|above warning]] about older kernel builds and systemd.}}
  
{{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).}}
+
It is possible to directly copy an installation of Arch Linux over the top of a working OpenVZ VPS.  This tutorial explains how to create a basic installation of Arch Linux with {{ic|pacstrap}} (as used in a standard install) and then replace the contents of a target VPS with it using [[rsync]].
  
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).
+
This process (with minor modification) also works to migrate existing Arch installations between various environments and has been confirmed to work in migrating from OpenVZ to Xen and from Xen to OpenVZ. For an install to Xen, other hardware-virtualized platforms, or probably even to physical hardware (unconfirmed), extra steps (basically running {{ic|mkinitcpio}} and [[Boot loaders|installing a bootloader]]) are needed.
  
{{bc|wget http://busybox.net/downloads/binaries/latest/busybox-i686
+
=====Prerequisites=====
chmod +x busybox-i686}}
+
  
First off you can get a list of packages that own files in /lib with the following command:
+
* A working Arch Linux installation
{{bc|<nowiki>
+
** To keep things simple, it should match the architecture you want to install on your VPS (x86_64 or i686).
pacman -Qo /lib/* | cut -d' ' -f 5 | egrep -v 'glibc' | uniq | xargs
+
** To build from other distributions, [[Archbootstrap|arch-bootstrap.sh]] can be used in place of {{ic|pacstrap}}.
</nowiki>}}
+
* The {{Pkg|arch-install-scripts}}, {{Pkg|rsync}}, and {{Pkg|openssh}} packages from the [[official repositories]]
 +
** SSH is not strictly required, but rsync over SSH is the method used here.
 +
* A VPS running any distribution, with {{ic|rsync}} and a working SSH server
 +
** Its architecture (x86_64 or i686) does not matter as long as the OpenVZ installation can support your target architecture.
 +
* OpenVZ's serial console feature (usually accessible via your provider's control panel)
 +
** Without this, any network configuration for the target VPS will have to be done immediately after the "Build" step below.
  
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:
+
=====Building a clean Arch Linux installation=====
  
{{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}}
+
As root, build the installation (optionally replacing {{ic|build}} with your preferred target directory):
  
You may have to remove /lib/udev/devices/loop0 (a simple rm works).
+
# mkdir build
 +
# pacstrap -cd build
  
After the upgrade finishes, you must remove any extra empty directories in /lib (/lib/modules is the common offender):
+
Other tweaks for the {{ic|pacstrap}} command:
{{bc|rm -rf /lib/modules}}
+
  
Install tzdata to fix some dependencies and remove /etc/profile.d/locale.sh:
+
*{{ic|-C custom-pacman-config.conf}} - Use a custom pacman configuration file. By default, pacstrap builds according to your local pacman.conf.  This determines the architecture (i686 or x86_64) of the build, the mirror list, etc.
{{bc|pacman -S tzdata
+
*{{ic|-B}} - Prevent pacstrap from copying your system's pacman keyring to the new build. If you use this option, you will need to run {{ic|pacman-key --init}} and {{ic|pacman-key --populate archlinux}} in the [[#Configuration|Configuration]] step to set up the keyring.
rm /etc/profile.d/locale.sh}}
+
*{{ic|-M}} - Prevent pacstrap from copying your system's pacman mirror list to the new build.
  
Remove /var/run (you should have nothing running that matters):
+
=====Replacing everything on the VPS with the Arch build=====
{{bc|rm -rf /var/run}}
+
  
Force glibc (this will pull in the latest filesystem, but BREAK everything (other than busybox)):
+
Replace all files, directories, etc. on your target VPS with the contents of your {{ic|build}} directory (replacing "YOUR.VPS.IP.ADDRESS" below):
{{bc|pacman -S --force glibc}}
+
  
Now you will have a broken system, so first thing symlink /usr/lib to /lib with busybox's ln:
+
{{Warning|Be careful with the following command. By design, {{ic|rsync}} is very destructive, especially with any of the {{ic|--delete}} options.}}
{{bc|./busybox-i686 ln -s /usr/lib /lib}}
+
  
And you should have a fully functional system where you can now update pacman.
+
# rsync -axH --delete-delay -e ssh --stats -P build/ YOUR.VPS.IP.ADDRESS:/
  
{{bc|pacman -S pacman; pacman-key --init; pacman-key --populate archlinux; pacman-db-upgrade; pacman -Syy}}
+
Explanation of options:
  
Now, update initscripts to get iproute2:
+
At minimum, only the {{ic|-a}} (preserve timestamps, permissions, etc.), {{ic|-x}} (do not cross filesystem boundaries), and {{ic|--delete}} (delete anything in the target that does not exist in the source) options are required.  The {{ic|--delete-delay}} option is an alternate deletion mode which waits to delete anything until the synchronization is otherwise complete; this is not necessary but may reduce the risk of a slow transfer causing the target VPS to lock-up. The {{ic|-H}} causes hardlinks to be preserved. The {{ic|-e ssh}} (use rsync over SSH) option is recommended and makes things simple.  The {{ic|--stats}} and {{ic|-P}} options are just to show more information.
  
{{bc|pacman -S iniscripts}}
+
=====Configuration=====
  
Install makedev:
+
# Reboot the VPS externally (using your provider's control panel, for example).
{{bc|pacman -S makedev}}
+
# Using OpenVZ's serial console feature, configure the [[network]] and [[Installation_guide#Configure_the_system|basic system settings]] (ignoring fstab generation and arch-chroot steps).
 
+
#* If you do not have access to the serial console feature, you will need to preconfigure your network settings before synchronizing Arch to the VPS.
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)]].
 
==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:
 
 
{{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:
 
 
1) Edit {{ic|/etc/pacman.conf}} and add the following repository '''ABOVE [core]''':
 
 
for 32-bit:
 
 
{{bc|<nowiki>[glibc-vps]
 
Server = https://dev.archlinux.org/~ibiru/openvz/glibc-vps/i686</nowiki>}}
 
 
for 64-bit:
 
 
{{bc|<nowiki>[glibc-vps]
 
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.
 
 
3) Upgrade the [[pacman]] database by running {{ic|pacman-db-upgrade}} as root.
 
 
4) Edit {{ic|/etc/pacman.conf.pacnew}} (new pacman config file) and add the following repository '''ABOVE [core]''':
 
 
{{bc|<nowiki>[glibc-vps]
 
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):
 
 
{{bc|mv /etc/pacman.conf.pacnew /etc/pacman.conf}}
 
 
6) Upgrade your whole system with new packages again {{ic|pacman -Syu}}
 
 
If you get the following or similar error:
 
{{bc|initscripts: /etc/profile.d/locale.sh exists in filesystem}}
 
 
Simply delete that file (e.g., {{ic|rm -f /etc/profile.d/locale.sh}}), then run {{ic|pacman -Syu}} again.
 
 
 
If you get the following or similar error:
 
{{bc|filesystem: /etc/mtab exists in filesystem}}
 
 
Run  {{ic|pacman -S filesystem --force}}
 
 
 
If you get the following or similar error:
 
{{bc|libusb-compat: /usr/bin/libusb-config exists in filesystem}}
 
 
Run {{ic|pacman -S libusb}} and then {{ic|pacman -S libusb-compat}}
 
 
7) Before rebooting, you need to [[pacman|install]] the {{Pkg|makedev}} package by running {{ic|pacman -S makedev}}.
 
 
8) Add MAKEDEV to {{ic|/etc/rc.local}}:
 
 
{{bc|/usr/sbin/MAKEDEV tty
 
/usr/sbin/MAKEDEV pty}}
 
 
9) Edit {{ic|/etc/inittab}}, comment out the following lines (otherwise you will see errors in {{ic|/var/log/errors.log}}):
 
 
{{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}}
 
 
10) To enable the use of the {{ic|hostname}} command, [[pacman|install]] the package {{Pkg|inetutils}} from the [[Official Repositories|official repositories]].
 
 
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
 
 
===SSH fails: PTY allocation request failed on channel 0===
 
 
Some VPSes have an outdated {{ic|rc.sysinit}}. You may be able to login via serial console or with
 
 
{{bc|> ssh root@broken.server '/bin/bash -i'}}
 
 
Then run the following:
 
 
{{bc|# mv /etc/rc.sysinit.pacnew /etc/rc.sysinit
 
# reboot}}
 
 
Once it’s working, you should be able to comment out the {{ic|udevd_modprobe}} line in {{ic|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.
 

Latest revision as of 05:23, 18 April 2016

Related articles

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.

This article discusses the use of Arch Linux on Virtual Private Servers, and includes some fixes and installation instructions specific to VPSes.

Warning:
  • Linux 2.6.32 is not supported by systemd since version 205 (and will not work with systemd-212 or higher). Since many container-based virtualization environments rely on older kernels, it may be impossible to keep an Arch Linux install up-to-date in such an environment. However, OpenVZ, as of kernel build 042stab094.7, has backported the CLOCK_BOOTTIME feature, making it work with later versions of systemd.
  • Systemd since version 220 doesn't work on OpenVZ containers. [1] This issue has been fixed in OpenVZ kernel 042stab111.1 [2]

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 template. Using Arch on other providers is possible but requires more work. Example methods include:
Provider Arch Release Virtualization Locations Notes
A MilesWeb VPS 2013.10.14 OpenVZ Europe, India, US Latest Arch Linux available on OpenVZ platform. Quick setup, 24/7 support via Live Chat, Email and Phone. VPS starts from $20 / mo
123 Systems 2010.05.xx OpenVZ Dallas, US-TX Arch available as a selection upon reinstall. Very old (2.6.18-308) kernel - See OpenVZ troubleshooting. Limited information available before purchase. Cannot verify Arch Linux version without purchase.
4smart.cz 2013.08 (x86_64) OpenVZ Europe, Prague when updating system make sure you use [tredaelli-systemd] in pacman.conf (see Unofficial user repositories
AUSWEB Latest Only (clarify?) VMware ESXi Sydney, AU Latest ISO (clarify?) of Arch Available. Enterprise Service.
affinity.net.nz 2013.08.01 KVM Auckland, New Zealand (NZ) IRC channel is #affinity on ircs.kiwicon.org
Atlantic.Net 2015.05.01 KVM NYC/SF/Toronto/Dallas/Orlando, US & Canada 100% SSD 1-click ArchLinux from $5/mo for 512M/20GB SSD, ready in 30 seconds
BuyVM 2013.07.01 KVM LA, Buffalo NY Must chose a different OS at sign up. Once accessible, choose to mount the latest Arch ISO and reboot to install manually.
Coinshost 2015.04 Xen Zurich, Switzerland $3/mo for 512M/20GB. Bitcoin and other cryptocurrencies accepted.
DirectVPS 2014.01.xx OpenVZ Amsterdam, NL; Rotterdam, NL Dutch language site. Version verifyable by clicking through https://www.directvps.nl/try-1.plp?p=31
Edis 2013.03.01 vServer, KVM, OpenVZ Multiple international locations. Also offer dedicated server options as well as an "off-shore" location at the Isle of Man (IM).
Gandi 2013.10.27 Xen Paris, FR; Baltimore, MD, US; Bissen, LU Very granular scaling of system resources (e.g. RAM, disk space); IPv6-only option available; you can supply your own install image, version based on keyring package version
GigaTux 2013.06.01 Xen Chicago, US-IL; Frankfurt, DE; London, GB; San Jose, US-CA
Host Virtual 2011.08.19 KVM Multiple International Locations Appears to use KVM virtualization. Site lists "Xen based virtualization" and features lists ability to install from ISO.
Hostigation 2010.05 i686 OpenVZ, KVM Charlotte, US-NC; Los Angeles, US-CA You can migrate to x86_64.
IntoVPS 2012.09.xx OpenVZ Amsterdam, NL; Bucharest, RO; Dallas, US-TX; Fremont, US-CA; London, GB Blog has not been updated since September, 2012 which included the Arch Linux update.
Kloud51 2014.7.7 OpenVZ US-CA, Canada SSD, 2 images available: A bare-bones system or a pre-configured Desktop with OpenBox, XRDP, Firefox, SSH Brute Force, Geany, and Yaourt.
Leapswitch Networks [2013.10.xx] OpenVZ/KVM USA, India, Portugal, Spain, Ukraine, Germany ArchLinux currently available in Control Panel for reinstall, not on order form.
Linode.com 2015.02.xx Xen, KVM Tokyo, JP; Multiple US; London, GB To run a custom kernel, install linux-linodeAUR. (linux will break on a 32-bit Linode.)
LYLIX 2014.01.xx OpenVZ Multiple US; Europe 32-bit and 64-bit available
Node Deploy 2014.10.01 OpenVZ, KVM Germany (DE); Los Angeles, US-CA; Atlanta, US-GA; Phoenix, US-AZ "At NodeDeploy we support virtually every linux distribution." Arch Linux is listed under their Operating Systems. No version information.
Netcup 2012.11.xx KVM Germany (DE) German language site.
OnePoundWebHosting 2013.05.xx Xen PV, Xen HVM United Kingdom (UK) They are a registrar too. Unable to verify server locations.
OVH Latest KVM France, Canada $3.5 for 2GB RAM and 10GB SSD, $7 for 4GB RAM and 20GB SSD.
proPlay.de 2012.12.xx OpenVZ, KVM Germany (DE) German language site.
QuickVZ 2013.10 OpenVZ, Xen Amsterdam, Netherlands (NL); Stockholm, Sweden (SE) Provide hardened Arch Linux images along with Enterprise services (e,g. VPN, Virtual Private LAN Service (VPLS) and Virtual Routers.
Rackspace Cloud 2013.6 Xen Multiple international locations Billed per hour. Use their "next gen" VPSes (using the mycloud.rackspace.com panel); the Arch image on the first gen Rackspace VPSes is out of date.
RamHost.us 2013.05.01 OpenVZ, KVM Los Angeles, US-CA; Great Britain (GB); Atlanta, US-GA; Germany (DE) You can request a newer ISO on RamHost's IRC network.
RamNode 2016.01.01 SSD and SSD Cached: KVM Alblasserdam, NL; Atlanta, GA-US; Los Angeles, CA-US; New York, NY-US; Seattle, WA-US You can request Host/CPU passthrough with KVM service.[3] Frequent use of discount promotions.[4], Must install Arch manually from an ISO using VNC viewer.
RoseHosting Latest OpenVZ, KVM St. Louis, Missouri, USA SSD powered hosting plans with free fully-managed 24/7 support
Tilaa 2014.10.01 KVM Amsterdam, NL English or Dutch language site.
TransIP 2016.02.01 KVM Amsterdam, NL English language site. Registrar.
XenVZ 2009.12.07 OpenVZ, Xen United Kingdom (UK), United States (US) Hardware
Virpus 2014.11.07 Xen Kansas City, US-KS; Los Angeles, US-CA A subcompany of Wow Technologies, Inc. 24/7 support via Live Chat, Email, Phone, and Ticket System. Service starts at $5/month.
Virtual Master 2012-08  ?? Europe, Prague
Vmline 2013.09.01 KVM, OpenVZ Kraków, PL S-Net reseller. Full virtualization. Polish language site.
VPSBG.eu 2013.10 OpenVZ Sofia, Bulgaria Offshore VPS in Bulgaria - anonymous registrations and Bitcoin are accepted.
VPS6.NET 2013.01.xx  OpenVZ, Xen, HVM-ISO Multiple US; Frankfurt, DE; Bucharest, RO; Istanbul, TR Registrar.
VPS.NET 2014.01.xx  OpenVZ, Xen, HVM-ISO US, Canada, UK, Brazil, Netherlands, France, Germany, Japan, Singapore, India, Austrlia; Multiple Managed & Un managed VPS service provider, multiple OS and configurations..
World4You 2015.10.28 OpenVZ Austria (AT) Internet hosting provider; quick setup; 24/7 support; shared web hosting; also CentOS, Debian, Ubuntu, Fedora and Arch OpenVZ servers; supports newest systemd (227 atm)

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 QEMU#Preparing an (Arch) Linux guest.

OpenVZ

Installing the latest Arch Linux on any OpenVZ provider

Warning: See the above warning about older kernel builds and systemd.

It is possible to directly copy an installation of Arch Linux over the top of a working OpenVZ VPS. This tutorial explains how to create a basic installation of Arch Linux with pacstrap (as used in a standard install) and then replace the contents of a target VPS with it using rsync.

This process (with minor modification) also works to migrate existing Arch installations between various environments and has been confirmed to work in migrating from OpenVZ to Xen and from Xen to OpenVZ. For an install to Xen, other hardware-virtualized platforms, or probably even to physical hardware (unconfirmed), extra steps (basically running mkinitcpio and installing a bootloader) are needed.

Prerequisites
  • A working Arch Linux installation
    • To keep things simple, it should match the architecture you want to install on your VPS (x86_64 or i686).
    • To build from other distributions, arch-bootstrap.sh can be used in place of pacstrap.
  • The arch-install-scripts, rsync, and openssh packages from the official repositories
    • SSH is not strictly required, but rsync over SSH is the method used here.
  • A VPS running any distribution, with rsync and a working SSH server
    • Its architecture (x86_64 or i686) does not matter as long as the OpenVZ installation can support your target architecture.
  • OpenVZ's serial console feature (usually accessible via your provider's control panel)
    • Without this, any network configuration for the target VPS will have to be done immediately after the "Build" step below.
Building a clean Arch Linux installation

As root, build the installation (optionally replacing build with your preferred target directory):

# mkdir build
# pacstrap -cd build

Other tweaks for the pacstrap command:

  • -C custom-pacman-config.conf - Use a custom pacman configuration file. By default, pacstrap builds according to your local pacman.conf. This determines the architecture (i686 or x86_64) of the build, the mirror list, etc.
  • -B - Prevent pacstrap from copying your system's pacman keyring to the new build. If you use this option, you will need to run pacman-key --init and pacman-key --populate archlinux in the Configuration step to set up the keyring.
  • -M - Prevent pacstrap from copying your system's pacman mirror list to the new build.
Replacing everything on the VPS with the Arch build

Replace all files, directories, etc. on your target VPS with the contents of your build directory (replacing "YOUR.VPS.IP.ADDRESS" below):

Warning: Be careful with the following command. By design, rsync is very destructive, especially with any of the --delete options.
# rsync -axH --delete-delay -e ssh --stats -P build/ YOUR.VPS.IP.ADDRESS:/

Explanation of options:

At minimum, only the -a (preserve timestamps, permissions, etc.), -x (do not cross filesystem boundaries), and --delete (delete anything in the target that does not exist in the source) options are required. The --delete-delay option is an alternate deletion mode which waits to delete anything until the synchronization is otherwise complete; this is not necessary but may reduce the risk of a slow transfer causing the target VPS to lock-up. The -H causes hardlinks to be preserved. The -e ssh (use rsync over SSH) option is recommended and makes things simple. The --stats and -P options are just to show more information.

Configuration
  1. Reboot the VPS externally (using your provider's control panel, for example).
  2. Using OpenVZ's serial console feature, configure the network and basic system settings (ignoring fstab generation and arch-chroot steps).
    • If you do not have access to the serial console feature, you will need to preconfigure your network settings before synchronizing Arch to the VPS.

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).