https://wiki.archlinux.org/api.php?action=feedcontributions&user=Adam+Berger&feedformat=atomArchWiki - User contributions [en]2024-03-28T14:20:00ZUser contributionsMediaWiki 1.41.0https://wiki.archlinux.org/index.php?title=Arch_Linux_on_a_VPS&diff=571832Arch Linux on a VPS2019-04-22T10:52:44Z<p>Adam Berger: Added a New Zealand hosting company to the list offering LXC Arch VPS</p>
<hr />
<div>[[Category:Installation process]]<br />
[[Category:Virtualization]]<br />
[[ja:Arch Linux VPS]]<br />
[[zh-hans:Arch Linux VPS]]<br />
{{Related articles start}}<br />
{{Related|Server}}<br />
{{Related articles end}}<br />
{{Move|Arch Linux on a VPS|''Arch Linux VPS'' isn't a proper term.}}<br />
From [[Wikipedia:Virtual private server]]:<br />
<br />
: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.<br />
<br />
This article discusses the use of Arch Linux on Virtual Private Servers, and includes some fixes and installation instructions specific to VPSes.<br />
<br />
{{Warning|<br />
* 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. Linux 2.6.32, used by OpenVZ 6, is not supported by systemd since version 205 (and will not work with systemd-212 or higher). OpenVZ does sometimes backport newer kernel features into its kernel, but as of 2018-06-27, a fresh installation of Arch does not work on OpenVZ 6 kernel version 2.6.32-042stab131.1 . Arch can be installed on OpenVZ 7, with [[#Preparing the Arch build for use on an OpenVZ 7 container|a minor workaround]], as of OpenVZ 7 kernel version 3.10.0-693-21.1.vz7.48.2 .}}<br />
<br />
==Providers that offer Arch Linux==<br />
<br />
{{Warning|We cannot vouch for the honesty or quality of any provider. Please conduct due diligence before ordering.}}<br />
{{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: <br />
* Loading custom disc images (requires hardware virtualization such as in Xen or KVM), <br />
* [[Installation guide|Installing under chroot]], for example with the help of the [https://gitlab.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 <br />
* Following [[#Installing the latest Arch Linux on any OpenVZ container provider]] instructions, using rsync to synchronize Arch over the top of another distribution.}}<br />
<br />
{| class="wikitable"<br />
! Provider !! Arch Release !! Virtualization !! Locations !! Notes<br />
|-<br />
| [https://www.1984hosting.com/ 1984hosting.com] || 2016.x || Xen || Iceland (IS) || [https://www.1984hosting.com/product/vps/ Hardware] will provide any image you request, has Arch in default image list.<br />
|-<br />
| [http://4smart.cz/ 4smart.cz] || 2013.08 || OpenVZ || Prague, CZ || (Czech language site only) when updating system make sure you use [tredaelli-systemd] in pacman.conf (see [[Unofficial user repositories]]<br />
|-<br />
| [https://www.affinity.net.nz/ affinity.net.nz] || 2013.08.01 || KVM || Auckland, New Zealand (NZ) || IRC channel is #affinity on ircs.kiwicon.org<br />
|-<br />
| [https://www.atlantic.net/ Atlantic.Net] || 2016.03.01 || KVM || NYC/SF/Toronto/Dallas/Orlando, US & Canada || 100% SSD 1-click Arch Linux, ready in 30 seconds. It is also easy to update Arch to the current version because the pre-provisioned Arch image is relatively current.<br />
|-<br />
| [https://buyvm.net/ BuyVM] || 2017.08.01 || KVM || Buffalo, (US-NY); Las Vegas, (US-NV); Luxembourg, Germany (DE) || Cannot select Arch at purchase. Once purchased, use Stallion control panel to install Arch manually from ISO. <br />
|-<br />
| [https://coinshost.com/en/vps Coinshost] || 2015.04 || Xen || Zurich, Switzerland || Bitcoin and other cryptocurrencies accepted.<br />
|-<br />
| [https://cherry.host Cherry Host] || Latest || KVM || Santee, US-CA || Must submit a support ticket to get Arch installed.<br />
|-<br />
| [https://contabo.com Contabo] || Latest || KVM || German || Only place to get 500 GB for 7€ - Decent speed. Other cheaps plans add snapshots, which is useful if you VPS runs a rolling release distro.<br />
|-<br />
| [https://www.directvps.nl/ DirectVPS] || 2014.01.xx || OpenVZ || Amsterdam, NL; Rotterdam, NL || (Dutch language site only)<br />
|-<br />
| [http://www.edis.at/en/ 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). Requires mounting an Arch ISO for a full manual install.<br />
|-<br />
| [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 || Currently, when changing to the US$ currency, the page breaks and it is not possible to provision a server.<br />
|-<br />
| [https://www.hostvirtual.com/ Host Virtual] || [https://www.hostvirtual.com/os/linux-vps/archlinux-vps 2014.06.01] || 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. VPS plans are very expensive with an setup fee as well.<br />
|-<br />
| [https://hostigation.com/ Hostigation] || [https://hostigation.com/?page=KVM Latest] || OpenVZ, KVM || Charlotte, US-NC; Los Angeles, US-CA || Arch is '''not''' currently listed as a choice.<br />
|-<br />
| [https://leapswitch.com Leapswitch Networks] || 2013.10.xx || OpenVZ/KVM || USA, India, Portugal, Spain, Ukraine, Germany || Arch Linux currently available in Control Panel for reinstall, not on order form. <br />
|-<br />
| [https://linevast.de Linevast.de] || Latest || OpenVZ, KVM || Germany || Arch Linux is possible on openvz and on KVM with the one click os installer. <br />
|-<br />
| [https://www.linode.com Linode] || [https://www.linode.com/distributions Latest] || KVM || [https://www.linode.com/speedtest/ Multiple US, London, Frankfurt, Tokyo, Singapore] || Linode instances are configured to run Arch's kernel by default. Linode provides custom kernels which can be selected in the manager settings. There are also community-supported kernels in the AUR, such as {{AUR|linux-linode}}.<br />
|-<br />
| [http://lylix.net/ LYLIX] || [http://lylix.net/archlinux 2014.01.xx] || OpenVZ || Multiple US; Europe || 32-bit and 64-bit available <br />
|-<br />
| [https://www.netcup.de/ Netcup] || 2012.11.xx || KVM || Germany (DE)|| (German language site only)<br />
|-<br />
| [https://www.medhahosting.com MedHaHosting ] || Latest || KVM || Buffalo, NY, USA; Atlanta, GA, USA; Chicago, IL, USA; Los Angeles, CA, USA || ArchLinux available on request. Many Linux and Windows hosting options. <br />
|-<br />
| [https://www.onepoundwebhosting.co.uk/ OnePoundWebHosting] || 2014.01 || Xen PV, Xen HVM || United Kingdom (UK) || They are a registrar too. Unable to verify server locations.<br />
|-<br />
| [https://www.ovh.com/us/vps/ OVH] || Latest || KVM || Beauharnois, Canada (CA); Frankfurt, Germany (DE); Gravelines, Stratsbourg, France (FR); Warsaw, Poland (PL); London, United Kingdom (UK) ||<br />
|-<br />
| [https://pacmanvps.com/ PacmanVPS] || 2014.01 || KVM || Canada (CA), Poland (PL) || Arch image is very old and PacmanVPS repos are broken. Not possible to update Arch. Site appears unmaintained.<br />
|-<br />
| [https://www.proplay.de/ Proplay] || Latest || OpenVZ, KVM || Germany (DE) || (German language site only)<br />
|-<br />
| [https://www.rackspace.com/cloud/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.<br />
|-<br />
| [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.<br />
|-<br />
| [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.<br />
|-<br />
| [https://www.rosehosting.com/ RoseHosting] || Latest || OpenVZ, KVM || St. Louis, Missouri, USA || SSD powered hosting plans with free fully-managed 24/7 support. No unmanaged VPS offerings.<br />
|-<br />
| [https://www.seedvps.com/ SeedVPS] || Latest || OpenVZ, KVM || Amsterdam, Netherlands || Linux VPS and Windows VPS Hosting in The Netherlands (NL). Newer ISO can be requested by opening a support ticket.<br />
|-<br />
| [https://www.servercheap.net Server Cheap] || Latest || OpenVZ, KVM || Chicago, Illinois, USA || ArchLinux available on request. Windows, BSD, and many Linux distribution hosting options. <br />
|-<br />
| [https://www.tilaa.com/ Tilaa] || 2016.03.01 || [https://www.tilaa.com/pages/vps/technology KVM] || Amsterdam, NL ||<br />
|-<br />
| [https://www.transip.eu/ TransIP] || [https://www.transip.eu/vps/vps-os/ 2017.01.01] || [https://www.transip.eu/vps/vps-technology/ KVM] || Amsterdam, NL || For latest image, submit ticket. Also registrar.<br />
|-<br />
| [https://upcube.io upCUBE] || Latest || Docker || Germany || Different prepared arch linux templates available<br />
|-<br />
| [http://virpus.com/ Virpus] || [http://virpus.com/linux-vps.php 2014.11.07] || Xen || Kansas City, US-KS; Los Angeles, US-CA || Arch is '''not''' offered as a choice when creating a server (even though the Arch logo is prominently featured on the site). As of 2018, the most recent version of Ubuntu offered is 14.04, and the limited-time promo code for new sign ups is over two years old. None of this generates much trust.<br />
|-<br />
| [https://www.virtualmaster.com/ Virtual Master] || 2012-08 || ?? || Prague, CZ ||<br />
|-<br />
| [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.<br />
|-<br />
| [https://www.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.<br />
|-<br />
| [https://www.vpscheap.net VPSCHEAP] || Latest || NVM KVM || Dallas, TX, USA || Has one plan that allows you to select ArchLinux, but doesn't appear in any other plan, but available on request <br />
|-<br />
| [https://www.vpsserver.com/ VPSSERVER] || 2015.07 || KVM || Chicago, US-IL; Dallas, US-TX; Miami, US-FL; New York, US-NY; Silicon Valley, US-CA; Amsterdam, NL; Frankfurt, DE; London, UK || Currently the latest Archlinux OS version we are providing is 2015.07 x64 and you can't update the OS version to the new version.<br />
|-<br />
| [https://www.vultr.com/ Vultr] || Latest || KVM || [https://www.vultr.com/locations/ Multiple International locations] || When deploying a new server just select the Arch install ISO from Vultr ISO Library. Then just manually run through the standard [[Installation guide|Arch installation guide]].<br />
|-<br />
| [https://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)<br />
|-<br />
| [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]<br />
|-<br />
| [https://zappiehost.com/ ZappieHost] || Latest || LXC || Auckland, New Zealand (NZ) || Hosted on redundant SSDs. Kernel 4.X using LXC<br />
|-<br />
| [https://www.zeptovm.com/ ZeptoVM] || Latest || KVM || St. Petersburg, RU; Khabarovsk, RU; Seoul, KR; Ashburn, US || Also provides local Archlinux mirror in some locations.<br />
|-<br />
|}<br />
<br />
==Installation==<br />
<br />
===KVM===<br />
{{Expansion|Are there instructions specific to VPSes?}}<br />
See [[QEMU#Preparing an (Arch) Linux guest]].<br />
<br />
===OpenVZ===<br />
<br />
====Installing the latest Arch Linux on any OpenVZ container provider====<br />
<br />
{{Warning|See the [[#top|above warning]]{{Broken section link}} about older kernel versions and systemd, and note the [[#Preparing the Arch build for use on an OpenVZ 7 container|workaround for OpenVZ 7 below]].}}<br />
<br />
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]].<br />
<br />
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 even to physical hardware, extra steps (basically running {{ic|mkinitcpio}} and installing a [[boot loader]]) are needed.<br />
<br />
=====Prerequisites=====<br />
<br />
* A working Arch Linux installation<br />
** To keep things simple, it should match the architecture you want to install on your VPS (x86_64 or i686).<br />
** To build from other distributions, [[Archbootstrap|arch-bootstrap.sh]] can be used in place of {{ic|pacstrap}}.<br />
* The {{Pkg|arch-install-scripts}}, {{Pkg|rsync}}, and {{Pkg|openssh}} packages from the [[official repositories]]<br />
** SSH is not strictly required, but rsync over SSH is the method used here.<br />
* A VPS running any distribution, with {{ic|rsync}} and a working SSH server<br />
** Its architecture (x86_64 or i686) does not matter as long as the OpenVZ installation can support your target architecture.<br />
* OpenVZ's serial console feature (usually accessible via your provider's control panel)<br />
** Without this, any network configuration for the target VPS will have to be done immediately after the "Build" step below.<br />
<br />
=====Building a clean Arch Linux installation=====<br />
<br />
As root, build the installation (optionally replacing {{ic|build}} with your preferred target directory):<br />
<br />
# mkdir build<br />
# pacstrap -cd build<br />
<br />
Other tweaks for the {{ic|pacstrap}} command:<br />
<br />
*{{ic|-C custom-pacman-config.conf}} - Use a custom pacman configuration file. By default, {{ic|pacstrap}} builds according to your local pacman.conf. This determines the architecture (i686 or x86_64) of the build, the mirror list, etc.<br />
*{{ic|-G}} - Prevent {{ic|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.<br />
*{{ic|-M}} - Prevent {{ic|pacstrap}} from copying your system's pacman mirror list to the new build.<br />
*You can pass a list of packages to {{ic|pacstrap}} to add them to your install, instead of the default {{ic|base}} group. For example: {{ic|pacstrap -cd build base openssh dnsutils gnu-netcat traceroute vim}}<br />
<br />
======Preparing the Arch build for use on an OpenVZ 7 container======<br />
<br />
OpenVZ 7 will fail to start a container if some expected network configuration files don't exist. The easiest way to get around this is as follows:<br />
<br />
# Create the OpenVZ 7 container as Debian 8 (Debian 9 would probably work as well).<br />
# Create the required blank network configuration files inside the Arch build, as follows:<br />
# mkdir build/etc/network<br />
# touch build/etc/network/interfaces<br />
# mkdir -p build/etc/resolvconf/resolv.conf.d<br />
# touch build/etc/resolvconf/resolv.conf.d/base<br />
<br />
=====Replacing everything on the VPS with the Arch build=====<br />
<br />
Replace all files, directories, etc. on your target VPS with the contents of your {{ic|build}} directory (replacing "YOUR.VPS.IP.ADDRESS" below):<br />
<br />
{{Warning|Be careful with the following command. By design, {{ic|rsync}} is very destructive, especially with any of the {{ic|--delete}} options.}}<br />
<br />
# rsync -axH --numeric-ids --delete-delay -e ssh --stats -P build/ YOUR.VPS.IP.ADDRESS:/<br />
<br />
Explanation of options:<br />
<br />
* {{ic|-a}} - Required. Preserves timestamps, permissions, etc.<br />
* {{ic|--delete}} - Required. Deletes anything in the target that does not exist in the source<br />
* {{ic|-x}} - Important. Prevents the crossing of filesystem boundaries (other partitions, /dev, etc.) during the copy<br />
* {{ic|-H}} - Important. Preserves hardlinks<br />
* {{ic|--numeric-ids}} - Important. Doesn't assign user/group ownership of files based on matching user and group names and instead uses the numeric IDs directly, ensuring proper file ownership on the target system<br />
* {{ic|--delete-delay}} - Recommended. Enables alternate deletion mode which waits to delete anything until the synchronization is otherwise complete, which may reduce the risk of a slow transfer causing the target VPS to lock-up<br />
* {{ic|-e ssh}} - Recommended. Uses {{ic|rsync}} over SSH (recommended for simplicity compared to setting up an {{ic|rsync}} server)<br />
* {{ic|-P}} - Recommended. Shows partial progress information during transfer<br />
* {{ic|--stats}} - Recommended. Shows transfer statistics at the end<br />
<br />
=====Configuration=====<br />
<br />
# Reboot the VPS externally (using your provider's control panel, for example).<br />
# 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).<br />
#* 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.<br />
#* On some VPS configuration you won't have a gateway to connect to, here is an example [[netctl]] configuration for this setup. It configures static IP addresses and default routes on venet0 and uses Google Public DNS.<br />
{{hc|/etc/netctl/venet|2=<br />
Description='VPS venet connection'<br />
Interface=venet0<br />
Connection=ethernet<br />
<br />
IP=static<br />
Address=('192.0.2.42/32')<br />
Routes=('default')<br />
<br />
IP6=static<br />
Address6=('2001:db8::1234:5678/128')<br />
Routes6=('default')<br />
<br />
DNS=('2001:4860:4860::8888' '2001:4860:4860::8844' '8.8.8.8' '8.8.4.4')<br />
}}<br />
<br />
===Xen===<br />
{{Expansion|Are there instructions specific to VPSes?}}<br />
See [[Xen]].</div>Adam Berger