Arch Linux on a VPS
摘自 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.
本文主要討論Arch Linux在VPS方面的應用, 並且包括了一些VPS的詳細的安裝於維護的指南.
支持Arch Linux的提供商[編輯 | 編輯原始碼]
提供商名 | Arch 版本 | 虛擬化環境 | 地理地點 | 注意事項 | |
---|---|---|---|---|---|
A MilesWeb VPS[失效連結 2020-12-19 ⓘ] | 2013.10.14 | OpenVZ | 歐洲, 印度, 美利堅 | 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 | 達拉斯, 美國-德克薩斯 | 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. | |
AUSWEB | 一律最新 (啥?) | VMware ESXi | 悉尼, 澳大利亞 | Latest ISO (clarify?) of Arch Available. Enterprise Service. | |
affinity.net.nz | 2013.08.01 | KVM | 奧克蘭, 新西蘭 | IRC channel is #affinity on ircs.kiwicon.org | |
Afterburst | 2012.12.01 | OpenVZ | 邁阿密, 美國-佛羅裡達; 紐倫堡, 德國 | 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[損壞的連結:無效的章節]. | |
BuyVM | 2013.07.01 | KVM | 洛杉磯, 水牛城 紐約 | Must chose a different OS at sign up. Once accessible, choose to mount the latest Arch ISO and reboot to install manually. | |
Edis[失效連結 2020-08-02 ⓘ] | 2013.03.01[失效連結 2020-08-02 ⓘ] | vServer, KVM, OpenVZ | 大量國際節點[失效連結 2020-08-02 ⓘ]. | Also offer dedicated server options as well as an "off-shore" location at the Isle of Man (IM). | |
DirectVPS | 2014.01.xx | OpenVZ | 阿姆斯特丹, 荷蘭; 洛特丹, 荷蘭 | Dutch language site. Version verifyable by clicking through https://www.directvps.nl/try-1.plp?p=31[失效連結 2021-05-09 ⓘ] | |
Gandi | 2013.10.27 | Xen | 巴黎, 法國; 巴爾地摩, 馬裡蘭, 美國; 比森, 盧森堡 | 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 | 芝加哥, 美國-伊利諾伊; 法蘭克福, 德國, 倫敦, 大不列顛; 聖瓊斯, 美國-加州 | ||
Host Virtual | 2011.08.19[失效連結 2020-08-02 ⓘ] | KVM | 大量國際節點[失效連結 2020-08-02 ⓘ] | Appears to use KVM virtualization. Site lists "Xen based virtualization" and features[失效連結 2020-08-02 ⓘ] lists ability to install from ISO. | |
Hostigation | 2010.05 i686[失效連結 2020-12-19 ⓘ] | OpenVZ, KVM | 夏洛特, 美國-北卡; 洛杉磯, 美國-加州 | You can migrate to x86_64. | |
IntoVPS | 2012.09.xx | OpenVZ | 阿姆斯特丹, 荷蘭; 布加列斯特, 羅馬尼亞; 達拉斯, 美國-德克薩斯; 費利蒙, 美國-加州; 倫敦, 大不列顛 | Blog has not been updated since September, 2012 which included the Arch Linux update. | |
Leapswitch Networks | [2013.10.xx] | OpenVZ/KVM | 美利堅, 印度, 葡萄牙, 西班牙, 烏克蘭, 德國 | ArchLinux currently available in Control Panel for reinstall, not on order form. | |
Linode.com[失效連結 2021-05-09 ⓘ] | 2013.06.xx[失效連結 2020-12-19 ⓘ] | Xen | 東京, 日本; 美國; 倫敦, 大不列顛 | To run a custom kernel, install linux-linodeAUR. (linux包 will break on a 32-bit Linode.) | |
LYLIX | 2014.01.xx[失效連結 2021-05-09 ⓘ] | OpenVZ | 美利堅; 歐洲 | 32-bit and 64-bit available | |
Node Deploy | 2014.10.01 | OpenVZ, KVM | 德國; 洛杉磯, 美國-加州; 亞特蘭大, 美國-佐治亞; 鳳凰城, 美國-亞利桑那 | "At NodeDeploy we support virtually every linux distribution." Arch Linux is listed under their Operating Systems. No version information. | |
Netcup | 2012.11.xx | KVM | 德國 | German language site. | |
OnePoundWebHosting | 2013.05.xx | Xen PV, Xen HVM | 英國 | They are a registrar too. Unable to verify server locations. | |
proPlay.de | 2012.12.xx | OpenVZ, KVM | 德國 | German language site. | |
QuickVZ[失效連結 2020-08-02 ⓘ] | 2013.10 | OpenVZ, Xen | 阿姆斯特丹, 荷蘭; 斯德哥爾摩, 瑞典 | Provide hardened Arch Linux images along with Enterprise services (e,g. VPN, Virtual Private LAN Service (VPLS) and Virtual Routers. | |
Rackspace Cloud[失效連結 2020-12-19 ⓘ] | 2013.6 | Xen | 大量國際節點[失效連結 2020-12-19 ⓘ] | 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 | 洛杉磯, 美國-加州; 大不列顛; 亞特蘭大, 美國-佐治亞; 德國 | You can request a newer ISO on RamHost's IRC network. | |
RamNode | 2013.07.01 | SSD and SSD Cached: OpenVZ, KVM | 西雅圖, 華盛頓 美國, 亞特蘭大, 佐治亞 美國 | You can request Host/CPU passthrough with KVM service.[1] Frequent use of discount promotions.[2] | |
Tilaa | 2014.10.01 | KVM[失效連結 2020-08-02 ⓘ] | 阿姆斯特丹, 荷蘭 | English or Dutch language site. | |
TransIP | 2013.05.01[失效連結 2020-08-02 ⓘ] | KVM | 阿姆斯特丹, 荷蘭 | English language site. Registrar. | |
XenVZ | 2009.12.07 | OpenVZ, Xen | 英國, 美利堅 | Hardware | |
Virpus | 2014.11.07 | Xen | 堪薩斯城, 美國-堪薩斯; 洛杉磯, 美國-加州 | A subcompany of Wow Technologies, Inc. 24/7 support via Live Chat, Email, Phone, and Ticket System. Service starts at $5/month. | |
Vmline | 2013.09.01 | KVM, OpenVZ | 克拉科夫, 波蘭 | S-Net[失效連結 2021-11-07 ⓘ] reseller. Full virtualization. Polish language site. | |
VPSBG.eu | 2013.10 | OpenVZ | 索菲亞, 保加利亞 | Offshore VPS in Bulgaria - anonymous registrations and Bitcoin are accepted. | |
VPS6.NET | 2013.01.xx | OpenVZ, Xen, HVM-ISO | 美國; 法蘭克福, 德國; 布加列斯特, 羅馬尼亞; 伊斯坦布爾, 土耳其 | Registrar. | |
VPS.NET | 2014.01.xx | OpenVZ, Xen, HVM-ISO | US, 加拿大, 英國, 巴西, 荷蘭, 法國, 德國, 日本, 新加坡, 印度, 澳大利亞 | Managed & Un managed VPS service provider, multiple OS and configurations.. |
安裝[編輯 | 編輯原始碼]
KVM[編輯 | 編輯原始碼]
參閱 QEMU#Preparing an Arch Linux guest.
OpenVZ[編輯 | 編輯原始碼]
在任意OpenVZ提供商上安裝Arch Linux[編輯 | 編輯原始碼]
It's 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 boot loader) are needed.
前置知識[編輯 | 編輯原始碼]
- 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.
搭建一個乾淨的Arch Linux[編輯 | 編輯原始碼]
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 runpacman-key --init
andpacman-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.
把VPS上的所有東西都Arch Arch掉[編輯 | 編輯原始碼]
把目標VPS上所有的文件, 目錄和其它各種東西都用你的build
目錄的內容替換掉 (把下面的 "YOUR.VPS.IP.ADDRESS" 換掉):
rsync
這個命令根據設計就是極具毀滅性的, 特別是帶上 --delete
選項的時候.# rsync -ax --delete-delay -e ssh --stats -P build/ YOUR.VPS.IP.ADDRESS:/
選項的解釋:
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 -e ssh
(use rsync over SSH) option is recommended and makes things simple. The --stats
and -P
options are just to show more information.
配置[編輯 | 編輯原始碼]
- 將VPS從外部重啟 (比如你可以利用provider的控制面板來幹這件事).
- 使用 OpenVZ 的端口控制特性來配置 網絡 和 基本系統設定 (無視 fstab 的生成和 arch-chroot 的相關步驟).
- 如果你接觸不到端口控制特性, 那你在把Arch Linux同步到VPS前就提前配置好你的網絡設定.
Xen[編輯 | 編輯原始碼]
參閱 Xen#Arch as Xen guest (PVHVM mode)[損壞的連結:無效的章節] 及/或 Xen#Arch as Xen guest (PV mode)[損壞的連結:無效的章節].