diff --git a/sources/tech/20170223 How to install Arch Linux on VirtualBox.md b/translated/tech/20170223 How to install Arch Linux on VirtualBox.md similarity index 56% rename from sources/tech/20170223 How to install Arch Linux on VirtualBox.md rename to translated/tech/20170223 How to install Arch Linux on VirtualBox.md index c607d1c3d5..1d8bbdf574 100644 --- a/sources/tech/20170223 How to install Arch Linux on VirtualBox.md +++ b/translated/tech/20170223 How to install Arch Linux on VirtualBox.md @@ -1,492 +1,495 @@ -# rusking translating -How to install Arch Linux on VirtualBox -============================================================ - -### On this page - -1. [Arch Linux Repositories][8] -2. [Install Arch Linux on Virtual Box][9] - 1. [Download Arch Linux][1] - 2. [Initializing Installation with Oracle VM VirtualBox Manager][2] - 3. [Partition the hard disk][3] - 4. [Bootstrap Arch Linux][4] - 5. [Setup hostname and networking][5] - 6. [Install the Bootloader][6] - 7. [Boot into the installed ArchLinux operating system][7] - -Arch Linux is a Linux-based operating system that is designed for i689 and 86-64 computers. Its unique package manager is responsible for providing updates to the latest software applications using “pacman” with complete tracking. Pacman is the package manager that is used to install, update, and remove the software packages. It is designed entirely for free and open-source software, along with the support from the Linux community. - -Arch Linux is also popular for having a comprehensive documentation in form of the community wiki known as ArchWiki. This Linux operating system is based on binary packages that are targeted for i832, 64-bit, and 32-bit systems and optimized for the best performance on the modern hardware systems. - -You can install Arch Linux directly to your home computer by following this guide but you can also install it on a virtual machine on your Windows computer by using VirtualBox. - -### Arch Linux Repositories - -To install Arch Linux on Virtual Box, you must know the basic repositories of this Linux-based operating system. A repository is a storage location from where the software packages are retrieved during the installation process. There are multiple repositories available for Arch Linux, which are accessible via pacman and maintained by package maintainers. Here is a list of some of the basic repositories used to install Arch Linux on Virtual Box: - -* The **core **repository contains all the packages that are needed to setup the base system like booting Arch Linux, and building packages. - -* The **extra **repository contains extra packages that do not fit in the core involving desktop environment. - -* The **community **repositoryhas packages that are adopted by trusted Linux community users, and most of them will transfer to the core or extra repository. - -* The **Multilib **repository contains 32-bit software and libraries for 32-bit application installation on 64-bit system. - -* The **testing **repository contains packages that are destined for core or extra repositories. - -* The **community-testing** repository is for the Linux community. - -* The **multilib testing **repositoryis similar to the testing repository, but for multilib candidates. - -* The **gnome-unstable **repository has the latest GNOME desktop environment. - -* The **kde-unstable **repository contains the latest KDE software before they are been released. - -### Install Arch Linux on Virtual Box - -### Download Arch Linux - -To install Arch Linux on Virtual Box, you must have the latest Arch Linux version that you can download from their [official website][10]. You can pick either the direct download option or torrent download, which is on a secure server. Before the installation, make sure you have 20 MB of free disk space and 1 GB of RAM in your system. - -[ - ![Download Arch Linux](https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/1212.png) -][11] - -### Initializing Installation with Oracle VM VirtualBox Manager - -Open the Oracle VM VirtualBox manager, click on new, and type in the name of the new operating system you want to create; in this case, it is Arch Linux. The system will automatically pick up the type and version of the Arch Linux, based on your system’s configuration. Click on  _next_ . - -[ - ![Open VirtualBox](https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/12121.png) -][12] - -Allocate the desired  RAM size to your new operating system, which is ideally 1024 MB. Click on  _next _ and then click on  _create_ , to create a virtual disk now. - -[ - ![Set RAM size](https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/12122.png) -][13] - -On the nextpage, you will be asked to select the type of hard disk file you want for your new operating system. Select VirtualBox Disk Image usually. - -[ - ![Select disk file type](https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/12123.png) -][14] - -Choose dynamically allocated and click  _next_ . - -[ - ![Allocate disk space dynamically](https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/12124.png) -][15] - -Allocate 20 GB hard disk file location and size. - -[ - ![Choose a hard disk size of 20GB](https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/12125.png) -][16] - -Now you can see that your Arch Linux operating system is created. Now you can click  _start_ . - -[ - ![Start the Virtual Machine](https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/12126.png) -][17] - -Click on 'browser' and select the startup disk, which you downloaded from the Arch Linux official website. - -[ - ![Choose Arch Linux Disk image](https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/12127.png) -][18] - -[ - ![Browse for disk image file](https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/12128.png) -][19] - -Click on  _start_  and then open the full-screen view. - -[ - ![Open the full-screen view](https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/12129.png) -][20] - -[ - ![Start the Arch Linux VM](https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/121210.png) -][21] - -### **Booting to Install Arch Linux on Virtual Box** - -You will see the first opening page of Arch Linux. Click on “Boot Arch Linux (x86_64), which is for 64-bit or click on “Boot Arch Linux (i686)”, which is for 32-bit. - -[ - ![Choose to boot Arch Linux](https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/121211.png) -][22] - -As soon as you click on the first option, the system will start booting. While it completes the temporary boot, we are basically moving into the live version and are logged in as root user. - -[ - ![Booting into Arch Linux live version](https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/121212.png) -][23] - -Check the Internet connection by typing in the following command. - - _ping google.com_ - -The word ping stands for packet internet gopher. You will soon see the response that means Arch Linux has activated the Internet connection. This is essential to perform certain installation steps. - -[ - ![Test internet connectivity with ping](https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/121213.png) -][24] - -Clear the command by typing - - _clear_ - -Before we start the installation, you should partition your drive. Type  _# fdisk – 1 _ and you will see the current system’s disk partition. Focus on the 20 GB hard drives that you allocated to Arch in the beginning. - -[ - ![Partition the harddisk](https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/121214.png) -][25] - -### Partition the hard disk - -We are going to partition this 20 GB space into three partitions. The first one is the primary root partition that will be of 10 GB. The second will be the swap partition, which will be twice the initial RAM allocation that will be 2048 MB. The third will be the logical partition that will be 8 GB allocated. - -[ - ![Create 3 disk partitions](https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/121215.png) -][26] - -Type the command: - - _cfdisk_ - - You will see gpt, dos, sgi, and sun. Select the  _dos _ option and press  _enter_ . - -[ - ![Create a partition of type DOS](https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/121216.png) -][27] - -Here you will see the main disk space, which is 20 GB. To change this, press on the free space and type 10G. - -[ - ![Choose 10GB partition size](https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/121217.png) -][28] - -Press  _enter _ and then click on the “primary” partition. - -[ - ![](https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/121218.png) -][29] - -Now select the “bootable” type by pressing enter on bootable. - -[ - ![Make partition bootable.](https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/121219.png) -][30] - -Go to  _write _ and press enter, to write partition to disk. - -[ - ![Write partition to disk](https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/121220.png) -][31] - -Then type  _yes_  to make the changes, successfully. - -[ - ![Confirm changes](https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/121221.png) -][32] - -Now the 10 GB partition is created. Click on  _free space _ and then enter the partition size of 2048 M. - -[ - ![Create the 2GB swap partition](https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/121222.png) -][33] - -Now follow the same steps to create the logical partition. Then press enter on  _quit_  and clear the command by typing - - _clear_ . - -[ - ![quit cfdisk](https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/121223.png) -][34] - -Format the newly partitioned disk by typing: - - _mkfs.ext4 /dev/sda1_ - -Here  _sda1 _ is the partition name. Repeat this for the second drive by typing: - - _mkfs.ext4 /dev/sda3_ - -and for the swap partition, - - _mkswap/dev/sda2_ . - -[ - ![Format the swap partition with mkswap](https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/121224.png) -][35] - -Activate the swap by typing: - - _swapon/ dev/ sda2_ - -and clear the command by typing: - - _clear_ . - -[ - ![Enable swap](https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/121225.png) -][36] - -Mount the primary partition to start the installation part by typing: - - _mount /dev/ sda1 / mnt._ - -[ - ![Mount the partitions](https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/121226.png) -][37] - -### Bootstrap Arch Linux - -Bootstrap the system by typing: - - _pacstrap /mnt base base-devel_ - -You can see that it is synchronizing the data packages. - -[ - ![Bootstrap Arch Linux](https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/121227.png) -][38] - -The installation will start and will take a few minutes. - -[ - ![Arch Linux installation has been started](https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/121228.png) -][39] - -After the base installation create the fstab file by tying: - - _genfstab /mnt>> /mnt/etc/fstab_ - -[ - ![Generating /etc/fstab](https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/121229.png) -][40] - -Configure locale, time and root password - -Change the system root to the Arch Linux installation directory by typing: - - _arch-chroot /mnt /bin /bash_ - - Now to configure the language settings: - - _nano /etc / local.gen_ - -[ - ![Set language in Arch Linux](https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/121230.png) -][41] - -Select the following language configuration by deleting the # and pressing  _control + x, _ press  _y_ , and press  _enter_ . - -[ - ![select language](https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/121231.png) -][42] - -Now activate it by typing: - - _locale-gen_ - -and press  _enter_ . - -[ - ![Generate the locales in Arch Linux](https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/121232.png) -][43] - -Create the  /etc/locale.conf file by typing: - - _nano /etc/locale.conf_ - -then press  _enter_ . Now you can add your language to the system by adding this line to the file: - -``` -LANG=en_US.UTF-8 -``` - - Then press  _control + x _ and press  _y_ , and press  _enter_ . - -[ - ![Set default language](https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/1.png) -][44] - -Synchronize the zone information by typing: - -ls user/share/zoneinfo_ - -and you will find a list of all the zones of the world. - -[ - ![Set System language default](https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/11.png) -][45] - -To select your zone, type: - - _ln –s /usr/share/zoneinfo/Asia/Kolkata/etc/localtime_ - -or you can select any name from the below list. - -[ - ![](https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/12.png) -][46] - -Set the time standard using the command. - - _hwclock --systohc –utc_ - -And the hardware clock is synchronized. - -[ - ![Set time](https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/13.png) -][47] - -Set the root user password by typing: - - _passwd_ - -And press  _enter_ . Then type your password and press enter. - -[ - ![Set the root password](https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/14.png) -][48] - -### Setup hostname and networking - -Enter the host name of the network by typing: - - _nano /etc/hostname_ - -and press  _enter_ . Now type any name and then press  _control + x _ and press  _y_ , and press  _enter_ . - -[ - ![Set the hostname](https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/15.png) -][49] - -Enable the dhcpcd by typing: - - _systemctl enable dhcpcd_ - -and it will be started at next boot time to fetch an IP address automatically. - -[ - ![Enable dhcpd](https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/16.png) -][50] - -### Install the Bootloader - -The final step, initiate the grub installation. Type: - - _pacman –S grub os-rober_ - -then press  _y _ and the download part will begin. - -[ - ![Configure grub](https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/17.png) -][51] - -Install the grub boot loader to the hard disk by typing: - - _grub-install /dev/sd_ - -and configure it: - - _grub-mkconfig –o/ boot/ grub/ grub.cfg_ - -[ - ![Install and configure grub boot loader](https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/18.png) -][52] - -Finally reboot the system by typing: - - _reboot_ - -and press  _enter._ - -[ - ![Reboot the system](https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/19.png) -][53] - -### Boot into the installed ArchLinux operating system - -Choose “Boot Existing OS” to boot Arch Linux on Virtual Box. - -[ - ![Boot Arch Linux](https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/110.png) -][54] - -Login with your root name and password, and you will enter your new Arch Linux operating system. - -[ - ![Arch Linux installed successfully](https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/111.png) -][55] - --------------------------------------------------------------------------------- - -via: https://www.howtoforge.com/tutorial/install-arch-linux-on-virtualbox/ - -作者:[Dimitris][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://www.howtoforge.com/tutorial/install-arch-linux-on-virtualbox/ -[1]:https://www.howtoforge.com/tutorial/install-arch-linux-on-virtualbox/#download-arch-linux -[2]:https://www.howtoforge.com/tutorial/install-arch-linux-on-virtualbox/#initializing-installation-with-oracle-vm-virtualbox-manager -[3]:https://www.howtoforge.com/tutorial/install-arch-linux-on-virtualbox/#partition-the-hard-disk -[4]:https://www.howtoforge.com/tutorial/install-arch-linux-on-virtualbox/#bootstrap-arch-linux -[5]:https://www.howtoforge.com/tutorial/install-arch-linux-on-virtualbox/#setup-hostname-and-networking -[6]:https://www.howtoforge.com/tutorial/install-arch-linux-on-virtualbox/#install-the-bootloader -[7]:https://www.howtoforge.com/tutorial/install-arch-linux-on-virtualbox/#boot-into-the-installed-archlinux-operating-system -[8]:https://www.howtoforge.com/tutorial/install-arch-linux-on-virtualbox/#arch-linux-repositories -[9]:https://www.howtoforge.com/tutorial/install-arch-linux-on-virtualbox/#install-arch-linux-on-virtual-box -[10]:https://www.archlinux.org/ -[11]:https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/big/1212.png -[12]:https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/big/12121.png -[13]:https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/big/12122.png -[14]:https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/big/12123.png -[15]:https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/big/12124.png -[16]:https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/big/12125.png -[17]:https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/big/12126.png -[18]:https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/big/12127.png -[19]:https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/big/12128.png -[20]:https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/big/12129.png -[21]:https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/big/121210.png -[22]:https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/big/121211.png -[23]:https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/big/121212.png -[24]:https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/big/121213.png -[25]:https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/big/121214.png -[26]:https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/big/121215.png -[27]:https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/big/121216.png -[28]:https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/big/121217.png -[29]:https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/big/121218.png -[30]:https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/big/121219.png -[31]:https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/big/121220.png -[32]:https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/big/121221.png -[33]:https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/big/121222.png -[34]:https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/big/121223.png -[35]:https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/big/121224.png -[36]:https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/big/121225.png -[37]:https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/big/121226.png -[38]:https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/big/121227.png -[39]:https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/big/121228.png -[40]:https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/big/121229.png -[41]:https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/big/121230.png -[42]:https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/big/121231.png -[43]:https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/big/121232.png -[44]:https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/big/1.png -[45]:https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/big/11.png -[46]:https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/big/12.png -[47]:https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/big/13.png -[48]:https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/big/14.png -[49]:https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/big/15.png -[50]:https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/big/16.png -[51]:https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/big/17.png -[52]:https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/big/18.png -[53]:https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/big/19.png -[54]:https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/big/110.png -[55]:https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/big/111.png +How to install Arch Linux on VirtualBox +============================================================ +在 VirtualBox 虚拟机中安装 Arch Linux 系统指南 + +### 本文导航 + +1、[Arch Linux 软件仓库][8] +2、[在 VirtualBox 虚拟机中安装 Arch Linux 系统][9] + 1、[下载 Arch Linux 系统][1] + 2、[在 Oracle VirtualBox 管理界面初始化安装][2] + 3、[磁盘分区][3] + 4、[引导 Arch Linux 启动][4] + 5、[设置主机名和网络][5] + 6、[安装引导加载程序][6] + 7、[启动进入 Arch Linux 系统][7] + +Arch Linux 是专门为 i689 和 86-64 架构的计算机而设计的基于 Linux 内核的操作系统。其特有的软件包管理器使用 “pacman" 命令的完整追踪方式来将系统应用软件升级到最新版本。 Pacman 是一个用于安装、升级和卸载软件包的管理器。这是一款完全免费和开源的软件,由 Linux 开源社区提供支持。 + +Arch Linux 也因其丰富的 Wiki 帮助文档而大受推崇。该系统基于二进制的软件包,这些软件包主要是为 i832、64 位和 32 位的系统而开发的,同时也为现代的硬件系统提供最佳的性能优化。 + +你可以参考这篇教程直接在你的本地电脑上安装 Arch Linux 系统,或者你也可以使用你的 Windows 电脑中的 VirtualBox 虚拟机来安装。 + +### Arch Linux 软件仓库 + +要在 VirtualBox 中安装 Arch Linux 系统,你得知道该系统的基础软件仓库。软件仓库用于在安装的过程中获取软件包。对于 Arch Linux 系统来说,有很多可用的软件仓库,可以使用 pacman 工具来进行维护。下面列出的是在 VirtualBox 中安装 Arch Linux 系统时用到的一些基础软件仓库列表: + +* **core ** 软件仓库包括所有的用于对系统进行基本设置的一些软件包,比如启动 Arch Linux 系统和编译软件包。 + +*  **extra ** 软件仓库包括 core 软件仓库以外的其它软件包以及与桌面环境相关的软件包。 + +* **community ** 软件仓库包含的是受信任的 Linux 社区用户采用的软件包,其中的大多数的软件包都会被迁移到核心软件仓库或者额外软件仓库中。 + +* **Multilib ** 软件仓库包括 32 位的软件包以及在 64 位操作系统中安装 32 位应用程序的类库。 + +* **testing ** 软件仓库包括那些即将成为核心或额外的软件包。 + +* **community-testing** 软件仓库主要用于 Linux 社区测试。 + +* **multilib testing ** 软件仓库跟测试软件仓库类似,但是它包含多种类型的类库。 + +* **gnome-unstable ** 软件仓库包括最新的 GNOME 桌面环境。 + +* **kde-unstable ** 软件仓库包括 KDE 最新的发布前的软件包。 + +### 在 VirtualBox 虚拟机中安装 Arch Linux 系统 + +### 下载 Arch Linux 系统 + +要在 VirtualBox 虚拟机中安装 Arch Linux 系统,你最好使用[官网][10]下载的新版 Arch Linux 系统。你可以选择直接下载或是种子方式下载系统文件,这是一个很安全的下载方式。在安装之前,确保你系统中有 20 MB 的剩余空间和 1 GB 的内存。 + +[ + ![Download Arch Linux](https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/1212.png) +][11] + +### 在 Oracle VirtualBox 虚拟机管理界面初始化系统安装 + +打开 Oracle VirtualBox 虚拟机管理界面,点击新建,输入你想创建的新系统的名称;这里输入的是 Arch Linux 。系统会自动选择 Arch Linux 的版本和类型,这取决于你的系统配置。单击_下一步_。 + +[ + ![Open VirtualBox](https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/12121.png) +][12] + +为你的新系统分配内存,最好是 1024 MB 。单击_下一步_,然后点击_新建_来创建一个虚拟磁盘。 + +[ + ![Set RAM size](https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/12122.png) +][13] + +在下一步中,你将会被经询问为新系统选择磁盘类型。通常选择 VirtualBox 磁盘镜像。 + +[ + ![Select disk file type](https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/12123.png) +][14] + +选择动态分配,单击_下一步_。 + +[ + ![Allocate disk space dynamically](https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/12124.png) +][15] + +分配 20 GB 的硬盘大小及位置 + +[ + ![Choose a hard disk size of 20GB](https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/12125.png) +][16] + +现在你可以看到 Arch Linux 系统已创建完成了。点击_开始_。 + +[ + ![Start the Virtual Machine](https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/12126.png) +][17] + +单击 ‘浏览’ 然后选择你从官网下载的启动磁盘。 + +[ + ![Choose Arch Linux Disk image](https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/12127.png) +][18] + +[ + ![Browse for disk image file](https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/12128.png) +][19] + +点击_启动_,然后打开全屏模式。 + +[ + ![Open the full-screen view](https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/12129.png) +][20] + +[ + ![Start the Arch Linux VM](https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/121210.png) +][21] + +### **在 VirtualBox 中启动并安装 Arch Linux 系统** + +你将会看到 Arch Linux 系统第一个打开界面。单击 “启动 Arch Linux (x86_64)”,用于 64 位系统,或者单击”Boot Arch Linux (i686)”,用于 32 位系统。 + +[ + ![Choose to boot Arch Linux](https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/121211.png) +][22] + +当你单击第一次选项后,系统将开始启动。实际上只是进入到一个临时启动状态,即进入到 Arch Linux 的自生系统,并以 root 帐号登录了。 + +[ + ![Booting into Arch Linux live version](https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/121212.png) +][23] + +输入下面的命令来检查网络连接。 + + _ping google.com_ + +这个单词 Ping 表示网路封包搜寻。你将会看到下面的返回信息,表明 Arch Linux 已经连接到外网了。这是执行安装过程中的很关键的一点。 + +[ + ![Test internet connectivity with ping](https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/121213.png) +][24] + +输入如下命令清屏: + + _clear_ + +在开始安装之前,你得先为硬盘分区。输入 _# fdisk – 1 _ ,你将会看到当前系统的磁盘分区情况。注意一开始你给 Arch Linux 系统分配的 20 GB 存储空间。 + +[ + ![Partition the harddisk](https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/121214.png) +][25] + +### 硬盘分区 + +我们打算把这个 20 GB 的磁盘分成三个分区。第一个主分区为 root 分区,大小为 10 GB 。第二个分区为 swap 分区,大小为内存的两倍,为 2048 MB 。第三个是逻辑分区,大小为 8 GB 。 + +[ + ![Create 3 disk partitions](https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/121215.png) +][26] + +输入下面的命令: + + _cfdisk_ + +你将看到 gpt , dos , sgi 和 sun 类型,选择 _dos _ 选项,然后按 _enter_ 。 + +[ + ![Create a partition of type DOS](https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/121216.png) +][27] + +这里你将看到主磁盘空间,大小为 20 GB 。在剩余空间外按 来修改分区大小,输入 10 GB 。 + +[ + ![Choose 10GB partition size](https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/121217.png) +][28] + +按 _enter _ 并单击 “主分区” 。 + +[ + ![](https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/121218.png) +][29] + +在可引导选项按 Enter 键选择 ”可引导“类型。 + +[ + ![Make partition bootable.](https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/121219.png) +][30] + +在 _写入_ 选项按 Enter 键将分区信息写入磁盘。 + +[ + ![Write partition to disk](https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/121220.png) +][31] + +之后输入 _yes_ 来应用更改。 + +[ + ![Confirm changes](https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/121221.png) +][32] + +现在已经创建完成 10 GB 的分区。单击 _剩余空间_ ,输入分区大小 2048 M 。 + +[ + ![Create the 2GB swap partition](https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/121222.png) +][33] + +以同样的方式创建逻辑方式。在 _退出_ 选项按 Enter 键,然后输入下面的命令来清屏: + + _clear_ . + +[ + ![quit cfdisk](https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/121223.png) +][34] + +输入下面的命令来格式化新建的分区: + + _mkfs.ext4 /dev/sda1_ + +这里的 _sda1 _ 是分区名。使用同样的命令来格式化第二个分区 sda3 : + + _mkfs.ext4 /dev/sda3_ + +格式化 swap 分区: + + _mkswap/dev/sda2_ . + +[ + ![Format the swap partition with mkswap](https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/121224.png) +][35] + +使用下面的命令来激活 swap 分区: + + _swapon/ dev/ sda2_ + +输入 clear 命令清屏: + + _clear_ . + +[ + ![Enable swap](https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/121225.png) +][36] + +输入下面的命令来挂载主分区以开始系统安装: + + _mount /dev/ sda1 / mnt._ + +[ + ![Mount the partitions](https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/121226.png) +][37] + +### 引导 Arch Linux 启动 + +输入下面的命令来引导系统启动: + + _pacstrap /mnt base base-devel_ + +可以看到系统正在同步数据包。 + +[ + ![Bootstrap Arch Linux](https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/121227.png) +][38] + +几分钟后将会开始安装系统。 + +[ + ![Arch Linux installation has been started](https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/121228.png) +][39] + +系统基本软件安装完成后,输入下面的命令来创建 fstab 文件: + + _genfstab /mnt>> /mnt/etc/fstab_ + +[ + ![Generating /etc/fstab](https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/121229.png) +][40] + +配置区域、时间和 root 帐号密码。 + +输入下面的命令来更改系统的根目录为 Arch Linux 的安装目录: + + _arch-chroot /mnt /bin /bash_ + + 现在来更改语言配置: + + _nano /etc / local.gen_ + +[ + ![Set language in Arch Linux](https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/121230.png) +][41] + +通过删除 # 以及按 _control + x ,按 _y_ ,然后再按 _enter_ 键来选择下面的语言配置: + +[ + ![select language](https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/121231.png) +][42] + +输入下面的命令来激活: + + _locale-gen_ + +按 _enter_ 键。 + +[ + ![Generate the locales in Arch Linux](https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/121232.png) +][43] + +使用下面的命令来创建 /etc/locale.conf 配置文件: + + _nano /etc/locale.conf_ + +然后按 _enter_ 。现在你就可以在配置文件中输入下面一行内容来为系统添加语言: + +``` +LANG=en_US.UTF-8 +``` + + 然后按 _control + x ,按 _y_ ,再按 _enter_ 。 + +[ + ![Set default language](https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/1.png) +][44] + +输入下面的命令来同步时区: + +ls user/share/zoneinfo_ + +下面你将整个世界的时区列表。 + +[ + ![Set System language default](https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/11.png) +][45] + +输入下面的命令来选择你所在的时区: + + _ln –s /usr/share/zoneinfo/Asia/Kolkata/etc/localtime_ + +或者你可以从下面的列表中选择其它名称。 + +[ + ![](https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/12.png) +][46] + +使用下面的命令来设置标准时间: + + _hwclock --systohc –utc_ + +硬件时钟已同步。 + +[ + ![Set time](https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/13.png) +][47] + +设置 root 帐号密码: + + _passwd_ + +按  _enter_ 。 然而输入你想设置的密码,按 enter 键确认。 + +[ + ![Set the root password](https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/14.png) +][48] + +### 设置主机名和网络 + +使用下面的命令来设置主机名: + + _nano /etc/hostname_ + +然后按 _enter_ 。输入你想设置的主机名称,按 _control + x ,按 _y_ ,再按 _enter_ 。 + +[ + ![Set the hostname](https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/15.png) +][49] + +启用 dhcpcd : + + _systemctl enable dhcpcd_ + +这样在下一次系统启动时, dhcpcd 将会自动启动,并自动获取一个 IP 地址: + +[ + ![Enable dhcpd](https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/16.png) +][50] + +### 安装引导加载程序 + +最后一步,输入以下命令来初始化 grub 安装。输入以下命令: + + _pacman –S grub os-rober_ + +然后按 _y _ ,将会下载相关程序。 + +[ + ![Configure grub](https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/17.png) +][51] + +使用下面的命令来将启动加载程序安装到硬盘上: + + _grub-install /dev/sd_ + +然后进行配置: + + _grub-mkconfig –o/ boot/ grub/ grub.cfg_ + +[ + ![Install and configure grub boot loader](https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/18.png) +][52] + +最后重启系统: + + _reboot_ + +然后按 _enter 。_ + +[ + ![Reboot the system](https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/19.png) +][53] + +### 启动进入到已安装完成的 Arch Linux 系统 + +选择“启动已存在的操作系统”选项来启动 Virtual Box 虚拟机中的 Arch Linux 系统。 + +[ + ![Boot Arch Linux](https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/110.png) +][54] + +使用 root 帐号和密码登录后,你将进入全新安装好的 Arch Linux 操作系统。 + +[ + ![Arch Linux installed successfully](https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/111.png) +][55] + +-------------------------------------------------------------------------------- + +via: https://www.howtoforge.com/tutorial/install-arch-linux-on-virtualbox/ + +译者简介: +春城初春/春水初生/春林初盛/春風十裏不如妳 + +作者:[Dimitris][a] +译者:[rusking](https://github.com/rusking) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://www.howtoforge.com/tutorial/install-arch-linux-on-virtualbox/ +[1]:https://www.howtoforge.com/tutorial/install-arch-linux-on-virtualbox/#download-arch-linux +[2]:https://www.howtoforge.com/tutorial/install-arch-linux-on-virtualbox/#initializing-installation-with-oracle-vm-virtualbox-manager +[3]:https://www.howtoforge.com/tutorial/install-arch-linux-on-virtualbox/#partition-the-hard-disk +[4]:https://www.howtoforge.com/tutorial/install-arch-linux-on-virtualbox/#bootstrap-arch-linux +[5]:https://www.howtoforge.com/tutorial/install-arch-linux-on-virtualbox/#setup-hostname-and-networking +[6]:https://www.howtoforge.com/tutorial/install-arch-linux-on-virtualbox/#install-the-bootloader +[7]:https://www.howtoforge.com/tutorial/install-arch-linux-on-virtualbox/#boot-into-the-installed-archlinux-operating-system +[8]:https://www.howtoforge.com/tutorial/install-arch-linux-on-virtualbox/#arch-linux-repositories +[9]:https://www.howtoforge.com/tutorial/install-arch-linux-on-virtualbox/#install-arch-linux-on-virtual-box +[10]:https://www.archlinux.org/ +[11]:https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/big/1212.png +[12]:https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/big/12121.png +[13]:https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/big/12122.png +[14]:https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/big/12123.png +[15]:https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/big/12124.png +[16]:https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/big/12125.png +[17]:https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/big/12126.png +[18]:https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/big/12127.png +[19]:https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/big/12128.png +[20]:https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/big/12129.png +[21]:https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/big/121210.png +[22]:https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/big/121211.png +[23]:https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/big/121212.png +[24]:https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/big/121213.png +[25]:https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/big/121214.png +[26]:https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/big/121215.png +[27]:https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/big/121216.png +[28]:https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/big/121217.png +[29]:https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/big/121218.png +[30]:https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/big/121219.png +[31]:https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/big/121220.png +[32]:https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/big/121221.png +[33]:https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/big/121222.png +[34]:https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/big/121223.png +[35]:https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/big/121224.png +[36]:https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/big/121225.png +[37]:https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/big/121226.png +[38]:https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/big/121227.png +[39]:https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/big/121228.png +[40]:https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/big/121229.png +[41]:https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/big/121230.png +[42]:https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/big/121231.png +[43]:https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/big/121232.png +[44]:https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/big/1.png +[45]:https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/big/11.png +[46]:https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/big/12.png +[47]:https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/big/13.png +[48]:https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/big/14.png +[49]:https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/big/15.png +[50]:https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/big/16.png +[51]:https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/big/17.png +[52]:https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/big/18.png +[53]:https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/big/19.png +[54]:https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/big/110.png +[55]:https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/big/111.png