Как установить arch linux на virtualbox
Перейти к содержимому

Как установить arch linux на virtualbox

  • автор:

Pre-installation

Arch is a “rolling release” distribution, download the .iso file from its offical site.

Create VM

Create a vm in virtualbox, make sure enable EFI in the motherboard. We will use use UEFI instead of the older BIOS spec to boot the VM.

Verify the boot mode

To verify the boot mode, list the efivars directory:

If the command shows the directory without error, then the system is booted in UEFI mode.

Partition the disks

We are going to use a simple partition scheme:

  • an EFI system partition (ESP)
  • one encrypted partition that holds our root filesystem
  • a small partition for swap space
List storage device

Start the actual partitioning process, run fdisk /dev/sda

  1. Create a GPT table by typing g (then hit enter).
  2. Create your ESP by typing n .
  3. Type t to change the type of the new partition (partition 1) to “EFI System”.
  4. Create your main root partition by typing n again. (This partition should already have the correct type, “Linux filesystem”)
  5. Create your swap partition by typing n and just take all the defaults.
  6. Type t to change the type of the swap partition (partition 3) to “Linux swap”
  7. Type p to show the current partition table. You should see an “EFI System” partition, a “Linux filesystem” partition, and a “Linux swap” partition.
  8. Type w to finally actually write the changes to disk.

Create filesystems

The ESP (EFI System Partition) has to be in a FAT format. Find ESP partition fdisk -l /dev/sda it should be sda1 mkfs.fat -F32 /dev/sda1 to create the FAT32 filesystem.

Root partition

Root partition should be /dev/sda2 , we are going to encrypt it. Details refer Arch doc

Open the encrypted partition

Use lsblk to see the hierarchy of these partitions, create the actual filesystem

Как установить Arch Linux на VirtualBox

Arch Linux — это операционная система на базе Linux, разработанная для компьютеров i689 и x86-64. Его уникальный менеджер пакетов отвечает за предоставление обновлений для последних программных приложений с использованием «pacman» с полным отслеживанием. Pacman — это менеджер пакетов, который используется для установки, обновления и удаления пакетов программного обеспечения. Он разработан полностью бесплатно и открыто. исходное программное обеспечение, а также поддержку сообщества Linux.

Arch Linux также популярен тем, что имеет исчерпывающую документацию в виде вики сообщества, известной как ArchWiki. Эта операционная система Linux основана на двоичных пакетах, предназначенных для i832, 64-разрядных и 32-разрядных систем и оптимизированных для обеспечения наилучшей производительности на современных аппаратных системах.

Вы можете установить Arch Linux непосредственно на свой домашний компьютер, следуя этому руководству, но вы также можете установить его на виртуальную машину на своем компьютере с Windows с помощью VirtualBox.

Репозитории Arch Linux

Чтобы установить Arch Linux на Virtual Box, вы должны знать основные репозитории этой операционной системы на базе Linux. Репозиторий — это место хранения, откуда пакеты программного обеспечения извлекаются в процессе установки. Для Arch Linux доступно несколько репозиториев, которые доступны через pacman и поддерживаются сопровождающими пакетов. Вот список некоторых основных репозиториев, используемых для установки Arch Linux на Virtual Box:

  • Репозиторий core содержит все пакеты, необходимые для настройки базовой системы, например для загрузки Arch Linux и сборки пакетов.
  • Дополнительный репозиторий содержит дополнительные пакеты, не вписывающиеся в ядро, включающее среду рабочего стола.
  • В репозитории сообщества есть пакеты, принятые доверенными пользователями сообщества Linux, и большинство из них будут перенесены в основной или дополнительный репозиторий.
  • Репозиторий Multilib содержит 32-разрядное программное обеспечение и библиотеки для установки 32-разрядных приложений в 64-разрядной системе.
  • Репозиторий testing содержит пакеты, предназначенные для основных или дополнительных репозиториев.
  • Репозиторий community-testing предназначен для сообщества Linux.
  • Репозиторий тестирования с несколькими библиотеками аналогичен репозиторию тестирования, но для кандидатов с несколькими библиотеками.
  • Репозиторий gnome-unstable содержит последнюю версию среды рабочего стола GNOME.
  • Репозиторий kde-unstable содержит последние версии программного обеспечения KDE до их выпуска.

Установите Arch Linux на виртуальную коробку

Скачать Арх Линукс

Чтобы установить Arch Linux на Virtual Box, у вас должна быть последняя версия Arch Linux, которую вы можете скачать с их официального сайта. Вы можете выбрать вариант прямой загрузки или загрузку через торрент, который находится на защищенном сервере. Перед установкой убедитесь, что в вашей системе есть 20 МБ свободного места на диске и 1 ГБ оперативной памяти.

Инициализация установки с помощью Oracle VM VirtualBox Manager

Откройте диспетчер Oracle VM VirtualBox, нажмите «Создать» и введите имя новой операционной системы, которую вы хотите создать; в данном случае это Arch Linux. Система автоматически подберет тип и версию Arch Linux в зависимости от конфигурации вашей системы. Нажмите Далее.

Выделите требуемый объем ОЗУ для новой операционной системы, в идеале 1024 МБ. Нажмите Далее, а затем нажмите Создать, чтобы создать виртуальный диск сейчас.

На следующей странице вам будет предложено выбрать тип файла на жестком диске для вашей новой операционной системы. Обычно выберите образ диска VirtualBox.

Выберите динамически размещенный и нажмите Далее.

Выделите 20 ГБ места и размера файла на жестком диске.

Теперь вы можете видеть, что ваша операционная система Arch Linux создана. Теперь вы можете нажать начать.

Нажмите на браузер и выберите загрузочный диск, который вы скачали с официального сайта Arch Linux.

Нажмите Пуск и откройте полноэкранный режим.

Загрузка для установки Arch Linux на Virtual Box

Вы увидите первую открытую страницу Arch Linux. Нажмите «Загрузить Arch Linux (x86_64)» для 64-разрядной версии или «Загрузить Arch Linux (i686)» для 32-разрядной версии.

Как только вы нажмете на первый вариант, система начнет загружаться. Пока он завершает временную загрузку, мы в основном переходим в живую версию и входим в систему как пользователь root.

Проверьте подключение к Интернету, введя следующую команду.

Слово ping расшифровывается как пакетный интернет-суслик. Вскоре вы увидите ответ, означающий, что Arch Linux активировал подключение к Интернету. Это необходимо для выполнения определенных шагов установки.

Очистите команду, набрав

Прежде чем мы начнем установку, вы должны разметить свой диск. Введите # fdisk – l , и вы увидите текущий системный раздел диска. Сосредоточьтесь на жестких дисках объемом 20 ГБ, которые вы выделили для Arch в начале.

Разметить жесткий диск

Мы собираемся разделить эти 20 ГБ пространства на три раздела. Первый — это основной корневой раздел размером 10 ГБ. Вторым будет раздел подкачки, который будет в два раза больше первоначального объема ОЗУ, составляющего 2048 МБ. Третьим будет логический раздел, на который будет выделено 8 ГБ.

Вы увидите gpt, dos, sgi и sun. Выберите параметр dos и нажмите enter.

Здесь вы увидите основное дисковое пространство, которое составляет 20 ГБ. Чтобы изменить это, нажмите на свободном месте и введите 10G.

Нажмите enter , а затем щелкните \основной раздел.

Теперь выберите тип «загрузочный», нажав Enter на загрузочном.

Перейдите к записать и нажмите клавишу ввода, чтобы записать раздел на диск.

Затем введите yes для успешного внесения изменений.

Теперь создан раздел размером 10 ГБ. Нажмите свободное место и введите размер раздела 2048 МБ.

Теперь выполните те же действия, чтобы создать логический раздел. Затем нажмите Enter при quit и очистите команду, набрав

Отформатируйте только что разбитый диск, набрав:

Здесь sda1 — имя раздела. Повторите это для второго диска, введя:

а для раздела подкачки

Активируйте своп, набрав:

и очистите команду, набрав:

Смонтируйте основной раздел, чтобы начать установочную часть, набрав:

Загрузочная арка Linux

Загрузите систему, набрав:

Вы можете видеть, что он синхронизирует пакеты данных.

Начнется установка, которая займет несколько минут.

После базовой установки создайте файл fstab, связав:

Настройте локаль, время и пароль root.

Измените системный корень на каталог установки Arch Linux, набрав:

Теперь, чтобы настроить параметры языка:

Выберите следующую языковую конфигурацию (en_US.UTF-8 UTF-8), удалив # и нажав control + x, нажмите y и нажмите enter .

Теперь активируйте его, набрав:

и нажмите ввод.

Создайте файл /etc/locale.conf, введя:

затем нажмите ввод. Теперь вы можете добавить свой язык в систему, добавив эту строку в файл:

Затем нажмите control + x , затем нажмите y и нажмите enter.

Синхронизируйте информацию о зоне, набрав:

и вы найдете список всех зон мира.

Чтобы выбрать зону, введите:

или вы можете выбрать любое имя из списка ниже.

Установите стандарт времени с помощью команды.

И аппаратные часы синхронизируются.

Установите пароль пользователя root, набрав:

И нажмите ввод. Затем введите свой пароль и нажмите Enter.

Настройка имени хоста и сети

Введите имя хоста сети, набрав:

и нажмите ввод. Теперь введите любое имя, а затем нажмите control + x , нажмите y и нажмите enter.

Включите dhcpcd, набрав:

и он будет запущен при следующей загрузке для автоматического получения IP-адреса.

Установите загрузчик

Последний шаг, инициируйте установку grub. Тип:

затем нажмите y , и начнется загрузка.

Установите загрузчик grub на жесткий диск, набрав:

и настройте его:

Наконец, выйдите из chroot, а затем перезагрузите систему, набрав:

и нажмите ввод.

Загрузитесь в установленную операционную систему ArchLinux.

Выберите «Загрузить существующую ОС», чтобы загрузить Arch Linux на Virtual Box.

Войдите под своим корневым именем и паролем, и вы войдете в свою новую операционную систему Arch Linux.

Setting Up Arch Linux in Virtural Box

jae/4118-LAST/arch-setup-2018-1.html as a starting point. When I created my vbox, I used the above plus:

I plan on using this a a template to modify till I am happy with it. Also, it will provide a document to rebuild a VM.

About Arch Linux

There are many Linux distributions out there. Arch Linux is our choice. Start by reading a little bit about it:

Create a VM

Download and install VirtualBox

Also install Oracle VM VirtualBox Extension Pack

Download archlinux-2018.01.01-x86_64.iso from Arch Linux Downloads page

Verify the file integrity checksum

Create a new VM in VirtualBox

Select Arch Linux (64-bit)

RAM: 1 GB bare minimum, 2 GB highly recommend (or even more, if your host machine has 8 GB)

Hard disk: 20 GB bare minimum, 50 GB or more recommended. Choose “Dynamically allocated” so that the virtual disk takes up only as much space as it is currently using. Choose “VDI (VirtualBox Disk Image)”.

Boot the VM using the live CD image you downloaded.

Install Arch Linux

Once the VM boots successfully into the Arch Live CD image, you are ready to install Arch onto your virtual hard disk. Follow the Arch Linux Installation guide carefully step-by-step.

The Arch Linux Installation guide – we’ll call it the Guide from now on – is detailed and comprehensive, but sometimes it’s a bit confusing. I have listed below some additional info and directions on some of the trickier sections of the Guide.

Note that what follows is NOT the whole instruction. They are clarifications and additional help on the Arch Linux Installation guide that you are supposed to follow.

Set the keyboard layout

Leave the default console keymap as US. Nothing to do here.

Verify the boot mode

Nothing to do here. In case you’re curious, we are booting in BIOS mode.

Connect to the Internet

Verify that the VM is connected to the Internet using the ping command.

Update the system clock

Follow the Guide’s instruction.

Partition the disks / Format the partitions / Mount the file systems

These sections point you to two other long documents, Partitioning and File systems, but don’t really tell you what to do. Skim through the documents to get an idea of what it’s talking about. Basically, you should come to an understanding of what a disk partition is.

Here is what you’ll actually do. First, create a single MBR partition which fills up the entire hard disk. We will use parted :

Once you are in parted (you know it because the prompt changes to (parted) ), run the following commands:

First we select “msdos” partition type, which is another name for the MBR partition type. Then we create a “primary” partition which will fill up 100% of the disk, and indicate that we will later format it as an “ext4” file system type. We then make the partition bootable. Finally run the print command to see if all is well before we quit out of parted.

If you paid attention to the print output, you will see that your partition doesn’t actually start at the beginning of the disk, even if we told it so. Parted skipped 1049kB at the start of the disk. Don’t worry. That’s the way it should be.

After creating the partition /dev/sda1, run the following command to format the partition as an ext4 filesystem:

Note that we do not create a swap partition because a swap file can be added later if necessary.

Lastly, don’t forget to mount the new partition at /mnt to begin filling it up with an Arch Linux installation:

Select the mirrors

You should edit /etc/pacman.d/mirrorlist to put a geographically close mirror server at the top of the file. For example, you can put the server hosted at Columbia University at the top of the list.

Install the base packages

Follow the Guide’s instruction.

Follow the Guide’s instruction.

Follow the Guide’s instruction.

The ln command in the Guide is missing the -f flag. Also, obviously, you should change Region/City with the actual region/city that you are in. For example:

And don’t forget to run:

Follow the Guide’s instruction to generate the en_US.UTF–8 locale, and set the LANG variable in /etc/locale.conf.

Optionally, put FONT=Lat2-Terminus16 in /etc/vconsole.conf , which will make the console look much nicer.

Follow the Guide’s instruction.

For configuring the network, all you need to do is to run the following command:

Nothing to do here.

Follow the Guide’s instruction.

This section points you to a lot of super confusing information. Here is all you need to do:

For the curious, we are installing the GRUB bootloader into our system, which uses BIOS/MBR boot method.

Follow the Guide’s instruction.

When you type “reboot” at the end, the virtual machine will reboot back into the install CD (which is a virtual CD mapped to the archlinux-YYYY.MM.DD-x86_64.iso file).

At this point, eject the virtual CD by clicking the round disk button on the status bar at the bottom of the VM window, and selecting “Remove disk from virtual drive”. If you get an error when you try to eject the CD, power off the virtual machine by closing the VM window, turn it back on, and try ejecting the CD again.

After you have successfully ejected the CD, power off the VM and turn it on again. You will boot into the newly installed Arch Linux.

Required reading

At this point, you have a minimally functional Arch Linux system. There are a few more things to do before you can use the system productively.

Before we begin, however, you must understand some basic concepts about Arch Linux. Please read the following short sections in the General Recommendations page:

Section 1: System administration

Section 2: Package management

Section 4: Graphical user interface

After you have read the sections, move on to the post-installation setup.

Post-installation setup

Pick a name for a non-root user and add the user. For example:

At this point, you can make the non-root user a “sudoer”. A sudoer can run a command as root by passing it through the sudo command.

First, install sudo:

Then, add the following lines to /etc/sudoers (you can omit the comments of course, and replace archie with your user name):

This is also a good time to install some essential packages:

And perhaps your favorite editors:

You can also try running a full system upgrade to see if any of your installed packages have new versions:

At this point, please take a snapshot of your VM from VirtualBox so that you can come back to this point if something goes wrong in the subsequent steps.

Install a video driver

We will be installing VirtualBox Guest Additions later, but for now, install the vesa driver by running pacman -S xf86-video-vesa . This will let you test X window system when you don’t have VirtualBox Guest Additions installed yet.

Choose and install a graphical interface

Linux offers a dizzying array of choices when it comes to graphical desktop environments. You can use whatever you like.

Xfce is what I use. Here is how to install it:

You can also install a GUI version of your editor and a web browser:

Before you start your Xfce4 desktop, log in as the non-root user. You can switch to the 2nd virtual console by pressing Ctrl-Alt-F2 . After you log in as a non-root user, you can type the following to start your Xfce4 desktop:

Install VirtualBox Guest Additions

Now you should install VirtualBox Guest Additions inside the VM. The Guest Additions will enable very useful features like dynamically resizing the VM window, copy & paste between guest and host, time sync between guest & host, and accessing the host file system from the guest.

In order to load the VirtualBox kernel modules and synchronize time with the host machine, type the following:

Enable “Bidirectional” Shared Clipboard from VirtualBox Manager’s Settings / General / Advanced menu.

Reboot the VM, start your Xfce4 desktop (or whatever desktop environment you’re using), launch a terminal window, and type ps ax | grep -i vbox . You should see an output like this:

Try copy & paste between host and guest.

You can look through Arch’s documentation on VirtualBox for more detailed info.

Switch to Linux LTS kernel

The stock kernel of Arch Linux stays pretty close to the bleeding edge, so it gets updated very frequently. Arch offers a more stable alternative based on a kernel version designated as a Long-Term Support (LTS) version. The linux package in Arch is the stock kernel and the linux-lts package is the LTS kernel. We are going to use the LTS kernel.

Install the LTS kernel packages.

Before we update the boot menu to include the new kernel, let’s tweak the settings of GRUB (our bootloader) by modifying /etc/default/grub .

First, you will find GRUB_DEFAULT=0 at the top of the file. Change it to:

so that GRUB will remember the last kernel you boosted from and make it the default entry next time you boot. Then you also need to add the following lines at the end of the file:

Optionally, while you’re editing this file, you can make your virtual console – the text-based command line before you start Xfce – a little bigger. Change GRUB_GFXMODE=auto to:

And make sure the following line is there and not commented out:

Also uncomment the following lines to have the menu screen in color:

After you modified /etc/default/grub , regenerate the GRUB configuration by running:

Verify that the new kernel works correctly:

Type uname -r to see the current kernel version you’re running

Reboot into the new LTS kernel

Type uname -r again to see the new LTS kernel version.

Some recommended UI improvements

Enable HiDPI support

If you have a HiDPI (High Dots Per Inch) display like Apple’s Retina Display, by default VirtualBox scales the screen to half of its native resolution. You can enable HiDPI support in VirtualBox Manager’s Settings / Display.

Now everything will look tiny. You need to do some work to make your desktop look good on a HiDPI screen. Here is an ArchWiki page on HiDPI.

Better terminal font

On a non-HiDPI display, I hate looking at anti-aliased fonts (i.e. fonts with shadows) in a terminal window. My favorite non-anti-aliased font is the Terminus font. Try switching your terminal font to it unless you are on a HiDPI display.

Customize your environment

The following ArchWiki pages have tons of tips on how to customize your working environment. (But be careful. You can spend infinite amount of time tweaking your working environment instead of, um, actually working.)

Congratulations! You have successfully installed and configured an Arch Linux system. Hopefully this is the beginning of a long-term relationship between Linux and you.

Name already in use

arch-linux / notes / arch-install-virtualbox.md

  • Go to file T
  • Go to line L
  • Copy path
  • Copy permalink
  • Open with Desktop
  • View raw
  • Copy raw contents Copy raw contents

Copy raw contents

Copy raw contents

Install Arch Linux

This guide is for installing Arch Linux as a VirtualBox guest using UEFI, grub bootloader, and Plasma (KDE 5) desktop

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *