Виртуальная машина на archlinux

VirtualBox/Install Arch Linux as a guest

This article is about installing Arch Linux in VirtualBox.

Boot the Arch installation media through one of the virtual machine’s virtual drives. Then, complete the installation of a basic Arch system as explained in the Installation guide.

Contents

Installation in EFI mode (optional)

Enabling EFI for Arch as guest is optional. If you want to install Arch Linux in EFI mode inside VirtualBox, you must change the firmware mode for the virtual machine. This must be done before installing Arch as guest, changing the option afterwards will result in unbootable machine unless the setting is reverted.

To enable EFI for a virtual machine using the graphical interface, open the settings of the virtual machine, choose System item from the panel on the left and Motherboard tab from the right panel, and check the checkbox Enable EFI (special OSes only).

Alternatively the same can be accomplished from the command line using VBoxManage:

efi will set the firmware for the virtual machine to EFI with the bitness matching the virtual machine’s CPU. To get a specific EFI bitness, set the firmware to efi64 for x86_64 EFI or efi32 for IA32 EFI.

After selecting the kernel from the Arch Linux installation media’s menu, the media will hang for a minute or two and will continue to boot the kernel normally afterwards. Be patient.

Starting with VirtualBox 6.1 the issue of forgetting NVRAM contents on shutdown is fixed. Proceed with the installation just as on a regular UEFI system.

Installation in EFI mode on VirtualBox

Once the system and the boot loader are installed, VirtualBox will first attempt to run /EFI/BOOT/BOOTX64.EFI from the ESP. If that first option fails, VirtualBox will then try the EFI shell script startup.nsh from the root of the ESP. This means that in order to boot the system you have the following options:

Do not bother with the VirtualBox Boot Manager (accessible with F2 at boot), as it is buggy and incomplete. It does not store efivars set interactively. Therefore, EFI entries added to it manually in the firmware (accessed with F12 at boot time) or with efibootmgr will persist after a reboot but are lost when the VM is shut down.

Install the Guest Additions

VirtualBox Guest Additions provides drivers and applications that optimize the guest operating system including improved image resolution and better control of the mouse. Within the installed guest system, install:

Set optimal framebuffer resolution

Виртуальная машина на archlinux. Смотреть фото Виртуальная машина на archlinux. Смотреть картинку Виртуальная машина на archlinux. Картинка про Виртуальная машина на archlinux. Фото Виртуальная машина на archlinuxThis article or section is a candidate for merging with VirtualBox/Tips and tricks#Set guest starting resolution.Виртуальная машина на archlinux. Смотреть фото Виртуальная машина на archlinux. Смотреть картинку Виртуальная машина на archlinux. Картинка про Виртуальная машина на archlinux. Фото Виртуальная машина на archlinux

Typically after installing Guest Additions, a fullscreen Arch guest running X will be set to the optimal resolution for your display; however, the virtual console’s framebuffer will be set to a standard, often smaller, resolution detected from VirtualBox’s custom VESA driver.

To use the virtual consoles at optimal resolution, Arch needs to recognize that resolution as valid, which in turn requires VirtualBox to pass this information along to the guest OS.

First, check if your desired resolution is not already recognized by running the command ( hwinfo need to be installed):

If the optimal resolution does not show up, then you will need to run the VBoxManage tool on the host machine and add «extra resolutions» to your virtual machine (on a Windows host, go to the VirtualBox installation directory to find VBoxManage.exe ). For example:

The parameters «Arch Linux» and «1360x768x24» in the example above should be replaced with your VM name and the desired framebuffer resolution. Incidentally, this command allows for defining up to 16 extra resolutions («CustomVideoMode1» through «CustomVideoMode16»).

Finally, add a video=resolution kernel parameter to set the framebuffer to the new resolution, for example:

Additionally you may want to configure your bootloader to use the same resolution. If you use GRUB, see GRUB/Tips and tricks#Setting the framebuffer resolution.

Load the VirtualBox kernel modules

To load the modules automatically, enable vboxservice.service which loads the modules and synchronizes the guest’s system time with the host.

To load the modules manually, type:

Launch the VirtualBox guest services

After the rather big installation step dealing with VirtualBox kernel modules, now you need to start the guest services. The guest services are actually just a binary executable called VBoxClient which will interact with your X Window System. VBoxClient manages the following features:

All of these features can be enabled independently with their dedicated flags:

Notice that VBoxClient can only be called with one flag at a time, each call spawning a dedicated service process. As a shortcut, the VBoxClient-all bash script enables all of these features.

virtualbox-guest-utils installs /etc/xdg/autostart/vboxclient.desktop that launches VBoxClient-all on logon. If your desktop environment or window manager does not support XDG Autostart, you will need to set up autostarting yourself, see Autostarting#On desktop environment startup and Autostarting#On window manager startup for more details.

Now, you should have a working Arch Linux guest. Note that features like clipboard sharing are disabled by default in VirtualBox, and you will need to turn them on in the per-VM settings if you actually want to use them (e.g. Settings > General > Advanced > Shared Clipboard).

Auto-resize Guest Display

Troubleshooting black screen with Plasma-X11 minimal install

If you used plasma-desktop minimal install instead of plasma (which includes Wayland support), then probably you will have black screen with cursor after starting Plasma-X11 session.

To fix this set resize vm window several times, then set resolution manually in VirtualBox window itself by:

Then install kdescreen package (hope you have some terminal available like console or xterm):

Hardware acceleration

Hardware acceleration can be activated in the VirtualBox options. The GDM display manager 3.16+ is known to break hardware acceleration support. [1] So if you get issues with hardware acceleration, try out another display manager (lightdm seems to work fine). [2] [3]

If the hardware acceleration does not work as expected, try changing the Graphics Controller option found under the Screen tab in the Display options of the settings GUI. It seems that depending on the host GPU type, not all emulated controllers work equally well.

Enable shared folders

Shared folders are managed on the host, in the settings of the Virtual Machine accessible via the GUI of VirtualBox, in the Shared Folders tab. There, Folder Path, the name of the mount point identified by Folder name, and options like Read-only, Auto-mount and Make permanent can be specified. These parameters can be defined with the VBoxManage command line utility. See there for more details.

No matter which method you will use to mount your folder, all methods require some steps first.

Two additional steps are needed in order for the mount point to be accessible from users other than root:

Manual mounting

Use the following command to mount your folder in your Arch Linux guest:

where shared_folder_name is the Folder name assigned by the hypervisor when the share was created.

If the user is not in the vboxsf group, to give them access to our mountpoint we can specify the mount(8) options uid= and gid= with the corresponding values of the user. These values can obtained from the id command run against this user. For example:

Automounting

You can use symlinks if you want to have a more convenient access and avoid to browse in that directory, e.g.:

Mount at boot

As of 2012-08-02, mount.vboxsf does not support the nofail option:

Troubleshooting

Access serial port from guest

TTY text too small during installation

From the host, VirtualBox Manager, set the Display Scale-factor to 2.00 or 3.00.

Guest freezes after starting Xorg

Faulty or missing drivers may cause the guest to freeze after starting Xorg, see for example [4] and [5]. Try disabling 3D acceleration in Settings > Display, and check if all Xorg drivers are installed.

Fullscreen mode shows blank screen

On some window managers (i3, awesome), VirtualBox has issues with fullscreen mode properly due to the overlay bar. To work around this issue, disable Show in Full-screen/Seamless option in Guest Settings > User Interface > Mini ToolBar. See the upstream bug report for more information.

If the guest’s screen goes black above a certain size (e.g. above 2048 pixels wide), increasing the Settings > Display > Screen > Video Memory can help.

Linux guests have slow/distorted audio

The AC97 audio driver within the Linux kernel occasionally guesses the wrong clock settings when running inside VirtualBox, leading to audio that is either too slow or too fast. To fix this, create a file in /etc/modprobe.d/ with the following line:

Linux guests have slow/laggy audio

In some cases, audio can have laggy performance (for example lag behind video when streaming video online). A possible workaround can be to use the Intel HD Audio controller in VirtualBox and disable its power saving by adding the following line in a file in /etc/modprobe.d/ in the guest OS:

Arch: pacstrap script fails

Windows host: VERR_ACCESS_DENIED

To access the raw VMDK image on a Windows host, run the VirtualBox GUI as administrator.

No hardware 3D acceleration in Arch Linux guest

To deal with this problem, apply the patch set at FS#49752#comment152254. Some fix to the patch set is required to make it work for version 5.2.16-2.

Источник

VMware/Install Arch Linux as a guest

This article is about installing Arch Linux in a VMware product, such as Player (Plus), Fusion or Workstation.

Contents

In-kernel drivers

The following drivers are only needed if you are running Arch Linux on a hypervisor like VMware vSphere Hypervisor. Client-server applications can write to the VMCI Sock (vsock) interface to make use of the VMCI virtual device, when communicating between virtual machines.

Some modules, such as the legacy vmhgfs shared folder module, will require additional work to manually compile and systemd enable in order to function properly.

VMware Tools versus Open-VM-Tools

In 2007, VMware released large partitions of the VMware Tools under the LGPL as Open-VM-Tools. The official Tools are not available separately for Arch Linux.

Originally, VMware Tools provided the best drivers for network and storage, combined with the functionality for other features such as time synchronization. However, now the drivers for the network/SCSI adapter are part of the Linux kernel.

The official VMware Tools also had the advantage of being able to use the Unity mode feature, but as of VMWare Workstation 12, Unity mode for Linux guests has been removed due to lack of use and developer difficulties in maintaining the feature. See this thread.

Open-VM-Tools

Utilities

The open-vm-tools package comes with the following utilities:

Modules

Installation

Try to install gtkmm3 manually if it does not work properly. To enable copy and paste between host and guest gtkmm3 is required.

Official VMware Tools

Modules

Installation (from guest)

Then, create bogus init directories for the installer:

The installer can then be mounted:

Extracted (e.g. to /root ):

The following build failures can safely be ignored:

Reboot the Virtual Machine:

Log in and start the VMware Tools:

Additionally, to auto start vmware-tools on boot, create a new file /etc/systemd/system/vmwaretools.service :

And enable the new systemd service:

Xorg configuration

However, if booting into multi-user.target or using an uncommon setup (e.g. multiple monitors), then vmtoolsd.service needs to be enabled. In addition to this, edit:

to give permission for loading drivers.

Tips and tricks

Shared Folders with vmhgfs-fuse utility

Share a folder by selecting Edit virtual machine settings > Options > Shared Folders > Always enabled, and creating a new share.

The shared folders should be visible with:

Now the folder can be mounted:

If the error message fusermount: option allow_other only allowed if ‘user_allow_other’ is set in /etc/fuse.conf is displayed, uncomment the following line in /etc/fuse.conf :

fstab

Add a rule for each share:

Create and mount the Shared Folders (if not done so already):

Systemd

Ensure the folder exists on the system. If this folder does not exist then it must be created, as the systemd service depends on it:

Legacy Shared Folders with vmhgfs module

Share a folder by selecting Edit virtual machine settings > Options > Shared Folders > Always enabled, and creating a new share.

Ensure the vmhgfs driver is loaded:

The shared folders should be viewable with:

Now the folder can be mounted:

Enable at boot

Edit mkinitcpio.conf thusly:

fstab

Add a rule for each share:

Create and mount the Shared Folders:

Systemd

Ensure the folder exists on the system. If this folder does not exist then it must be created, as the systemd scripts depend on it:

Enable the mnt-hgfs.automount mount target.

Prune mlocate DB

3D Acceleration

If not selected at guest creation time, 3D Acceleration can be enabled in: Edit virtual machine settings > Hardware > Display > Accelerate 3D graphics.

OpenGL and GLSL support

It is possible to update OpenGL and GLSL with new kernel modules, overriding Arch-controlled versions.

Currently, OpenGL 3.3 and GLSL 3.30 can be supported. See https://bbs.archlinux.org/viewtopic.php?id=202713 for more details.

Time synchronization

Configuring time synchronization in a Virtual Machine is important; fluctuations are bound to occur more easily in a guest VM. This is mostly due to the CPU being shared by more than one guest.

There are 2 options to set up time synchronization: the host or an external source.

Host machine as time source

To use the host as a time source, ensure vmtoolsd.service is started. Then enable the time synchronization:

To synchronize the guest after suspending the host:

External server as time source

Troubleshooting

Network slow on guest

Arch Linux, as well as other Linux guests, may have slow network speeds while using NAT. To resolve this, switch the network type to Bridged mode in the guest settings on the host, changing the configuration file for the network on the guest where necessary. For more information on configuration, see Network configuration. If on a Windows host and it is not connecting properly despite correct guest configuration, open the Virtual Network Editor on the host as Administrator and press the Restore defaults button at the bottom left.

File share problems with legacy vmhgfs module and newer kernels

As the open-vm-tools-dkms AUR [broken link: package not found] package is no longer being updated, newer kernels are not patched correctly using it to be compatible with a host-guest file share. The Github repository has some patch files that can be manually applied to restore functionality.

It is also recommended that the AUR comment section be checked for this package.

Sound problems

If unacceptably loud or annoying sounds occur, then it may be related to the PC speaker. The issue may be resolved by disabling the PC speaker within the guest image:

Mouse problems

The following problems may occur with the mouse:

These may be fixed by uninstalling the xf86-input-vmmouse package. xf86-input-vmmouse and xf86-input-libinput should be sufficient for handling mouse and keyboard inputs.

VMware also attempts to automatically optimize the mouse for gaming. If problems are experienced, disabling the optimization is recommended: Edit > Preferences > Input > Optimize mouse for games: Never

Alternatively, attempting to disable the catchall event in 60-libinput.conf may be required:

Boot problems

Slow boot time

The following errors may be displayed if VMWare’s memory hot-add feature is enabled:

Shutdown/Reboot hangs

Adjust the timeout for the vmtoolsd service (defaults to 90 seconds).

Window resolution autofit problems

«Autofit» means that when the VMWare window’s size is adjusted in the host, ArchLinux in the guest should automatically follow and readjust its resolution to fit the new size of the host window.

Potential solution 1

Potential solution 2

For some reason, autofit requires the packages gtkmm and gtk2, so ensure they are installed. If X windows is not installed or a non–GTK-based desktop environment (such as KDE) is being used, the might have to be installed independently.

Potential solution 3

The relevant modules may have to be added to mkinitcpio.conf:

Potential solution 4

If this does not work, ensure the vmtoolsd.service is restarted.

Potential solution 5

Drag and drop, copy/paste

The drag-and-drop (copy/paste) feature requires both open-vm-tools and gtkmm3 packages to be installed.

Make the command vmware-user run after X11 by either:

Copy/paste does not currently work on Wayland, though applications running through XWayland work fine.

Problems when running as a shared VM on Workstation 11

Workstation 11 has a bug where vmware-hostd crashes if an Arch guest is running as a shared VM and vmtoolsd is running in the guest. A patch to open-vm-tools to work around the bug is here.

Shared folder not mounted after system upgrade

Источник

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

Виртуальная машина на archlinux. Смотреть фото Виртуальная машина на archlinux. Смотреть картинку Виртуальная машина на archlinux. Картинка про Виртуальная машина на archlinux. Фото Виртуальная машина на archlinux

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

VirtualBox — это бесплатный кроссплатформенный инструмент виртуализации с открытым исходным кодом от Oracle, который позволяет создавать виртуальные машины и опробовать различные операционные системы. Его легко установить и использовать, и вы можете создавать свои собственные виртуальные машины, назначать им такие ресурсы, как ЦП и ОЗУ, и даже клонировать их. В этом разделе мы продемонстрируем, как вы можете установить VirtualBox и его пакет расширений в Arch Linux.

Установка VirtualBox в Arch Linux

Чтобы установить VirtualBox в вашей системе, выполните следующие действия.

Шаг 1) Установите пакет VirtualBox

Установка VirtualBox настолько проста, насколько это возможно. Просто запустите терминал и как пользователь sudo просто выполните команду:

Виртуальная машина на archlinux. Смотреть фото Виртуальная машина на archlinux. Смотреть картинку Виртуальная машина на archlinux. Картинка про Виртуальная машина на archlinux. Фото Виртуальная машина на archlinux

Когда будет предложено продолжить установку, введите « и нажмите «Продолжить», чтобы установить пакеты и зависимости VirtualBox.

Виртуальная машина на archlinux. Смотреть фото Виртуальная машина на archlinux. Смотреть картинку Виртуальная машина на archlinux. Картинка про Виртуальная машина на archlinux. Фото Виртуальная машина на archlinux

Затем загрузите модуль ядра виртуального бокса с помощью команды:

Виртуальная машина на archlinux. Смотреть фото Виртуальная машина на archlinux. Смотреть картинку Виртуальная машина на archlinux. Картинка про Виртуальная машина на archlinux. Фото Виртуальная машина на archlinux

На этом этапе VirtualBox установлен в вашей системе Arch Linux. Однако нам необходимо установить пакет расширений VirtualBox, чтобы включить возможности VirtualBox USB 2.0 и 3.0. Это позволит вашим виртуальным машинам обнаруживать USB-накопители, подключенные к хост-системе, и работать с ними.

Шаг 2) Установите пакет расширения VirtualBox

Виртуальная машина на archlinux. Смотреть фото Виртуальная машина на archlinux. Смотреть картинку Виртуальная машина на archlinux. Картинка про Виртуальная машина на archlinux. Фото Виртуальная машина на archlinux

Затем установите пакет расширений VirtualBox с помощью команды:

Виртуальная машина на archlinux. Смотреть фото Виртуальная машина на archlinux. Смотреть картинку Виртуальная машина на archlinux. Картинка про Виртуальная машина на archlinux. Фото Виртуальная машина на archlinux

Вам также необходимо включить vboxweb, чтобы он запускался при загрузке и запускал службу.

Виртуальная машина на archlinux. Смотреть фото Виртуальная машина на archlinux. Смотреть картинку Виртуальная машина на archlinux. Картинка про Виртуальная машина на archlinux. Фото Виртуальная машина на archlinux

Отлично, Сервис тоже успешно запустился. Давайте проверим, загружен ли модуль ядра VirtualBox или нет, запустите ниже команду lsmod

Виртуальная машина на archlinux. Смотреть фото Виртуальная машина на archlinux. Смотреть картинку Виртуальная машина на archlinux. Картинка про Виртуальная машина на archlinux. Фото Виртуальная машина на archlinux

В выводе должны отображаться модули ядра vbox, как показано выше.

Шаг 3) Запуск VirtualBox

Чтобы запустить Virtualbox, используйте диспетчер приложений, нажав супер-клавишу или клавишу Windows — в случае диспетчера рабочего стола GNOME — и найдите VirtualBox, как показано ниже.

Виртуальная машина на archlinux. Смотреть фото Виртуальная машина на archlinux. Смотреть картинку Виртуальная машина на archlinux. Картинка про Виртуальная машина на archlinux. Фото Виртуальная машина на archlinux

После этого щелкните значок Virtualbox, чтобы запустить его. Наконец, вы должны увидеть окно VirtualBox, как показано ниже.

Виртуальная машина на archlinux. Смотреть фото Виртуальная машина на archlinux. Смотреть картинку Виртуальная машина на archlinux. Картинка про Виртуальная машина на archlinux. Фото Виртуальная машина на archlinux

Чтобы подтвердить, что пакет расширений был установлен, нажмите « Файл », затем перейдите в « Настройки ». Вы также можете нажать сочетание клавиш « CTRL + G ».

Виртуальная машина на archlinux. Смотреть фото Виртуальная машина на archlinux. Смотреть картинку Виртуальная машина на archlinux. Картинка про Виртуальная машина на archlinux. Фото Виртуальная машина на archlinux

В следующем окне нажмите « Расширения ». На правой панели будут отображаться Имя и версия пакета расширений. Чтобы вернуться в главное окно, нажмите кнопку « ОК ».

Виртуальная машина на archlinux. Смотреть фото Виртуальная машина на archlinux. Смотреть картинку Виртуальная машина на archlinux. Картинка про Виртуальная машина на archlinux. Фото Виртуальная машина на archlinux

Мы, наконец, установили пакет расширений VirtualBox и VirtualBox, чтобы обеспечить дополнительную функциональность вашим виртуальным машинам.

Источник

How to Install VirtualBox on Arch Linux

VirtualBox is a free and open source, cross platform virtualization tool from Oracle that allows you to create virtual machines and try out different operating systems. It’s easy to install and use and you can create your own virtual machines, assign them resources such as CPU and RAM and even clone them. In this topic we will demonstrate how you can install VirtualBox and its extension pack on Arch Linux.

Installing VirtualBox on Arch Linux

To get VirtualBox on your system, follow the steps below.

Step 1) Install VirtualBox package

Installing VirtualBox is as easy as it gets. Just launch the terminal and a s a sudo user, simply run the command:

Виртуальная машина на archlinux. Смотреть фото Виртуальная машина на archlinux. Смотреть картинку Виртуальная машина на archlinux. Картинка про Виртуальная машина на archlinux. Фото Виртуальная машина на archlinux

When prompted to proceed with installation type ‘Y’ and hit continue to install the VirtualBox packages and dependencies.

Next, add the current user to the vboxusers group by running the command:

Виртуальная машина на archlinux. Смотреть фото Виртуальная машина на archlinux. Смотреть картинку Виртуальная машина на archlinux. Картинка про Виртуальная машина на archlinux. Фото Виртуальная машина на archlinux

Next, load the virtualbox kernel module using the command:

Виртуальная машина на archlinux. Смотреть фото Виртуальная машина на archlinux. Смотреть картинку Виртуальная машина на archlinux. Картинка про Виртуальная машина на archlinux. Фото Виртуальная машина на archlinux

At this point, VirtualBox is installed on your Arch Linux system. However, we do need to install the VirtualBox extension pack to enable VirtualBox USB 2.0 and 3.0 capabilities. This will allow your virtual machines to detect and work with USB pen drives which are plugged on the host system.

Step 2) Install VirtualBox extension package

To install the Virtualbox extension package, first update the system using either yaourt or yay package managers as shown:

Виртуальная машина на archlinux. Смотреть фото Виртуальная машина на archlinux. Смотреть картинку Виртуальная машина на archlinux. Картинка про Виртуальная машина на archlinux. Фото Виртуальная машина на archlinux

Next, install the VirtualBox extension pack using the command:

Виртуальная машина на archlinux. Смотреть фото Виртуальная машина на archlinux. Смотреть картинку Виртуальная машина на archlinux. Картинка про Виртуальная машина на archlinux. Фото Виртуальная машина на archlinux

You also need to enable vboxweb for it to start on boot and start the service

Виртуальная машина на archlinux. Смотреть фото Виртуальная машина на archlinux. Смотреть картинку Виртуальная машина на archlinux. Картинка про Виртуальная машина на archlinux. Фото Виртуальная машина на archlinux

Perfect, Service also got started successfully. Let’s verify the VirtualBox Kernel module is loaded or not, run below lsmod command

Виртуальная машина на archlinux. Смотреть фото Виртуальная машина на archlinux. Смотреть картинку Виртуальная машина на archlinux. Картинка про Виртуальная машина на archlinux. Фото Виртуальная машина на archlinux

The output should display vbox kernel modules as shown above.

Step 3) Launching VirtualBox

To launch Virtualbox, use the applications manager by pressing the Super Key or Windows Key – for the case of GNOME desktop manager – and search for VirtualBox as shown below.

Виртуальная машина на archlinux. Смотреть фото Виртуальная машина на archlinux. Смотреть картинку Виртуальная машина на archlinux. Картинка про Виртуальная машина на archlinux. Фото Виртуальная машина на archlinux

Thereafter, click on the Virtualbox icon to launch it. You should finally see the VirtualBox window as shown below.

Виртуальная машина на archlinux. Смотреть фото Виртуальная машина на archlinux. Смотреть картинку Виртуальная машина на archlinux. Картинка про Виртуальная машина на archlinux. Фото Виртуальная машина на archlinux

To confirm that the extension pack was installed, click on ‘File’ then navigate to ‘Preferences’. You can alternatively hit the ‘CTRL + G’ keyboard shortcut.

Виртуальная машина на archlinux. Смотреть фото Виртуальная машина на archlinux. Смотреть картинку Виртуальная машина на archlinux. Картинка про Виртуальная машина на archlinux. Фото Виртуальная машина на archlinux

On the next window, click on ‘Extensions’. On the right pane, the Name and the version of the extensions package will be displayed. To return to the main window click on the ‘OK’ button.

Виртуальная машина на archlinux. Смотреть фото Виртуальная машина на archlinux. Смотреть картинку Виртуальная машина на archlinux. Картинка про Виртуальная машина на archlinux. Фото Виртуальная машина на archlinux

We have finally installed VirtualBox and VirtualBox extensions pack to provide extra functionality to your virtual machines.

Источник

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

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