You are not logged in.

#1 2020-10-19 22:23:37

gwpl
Member
From: Warsaw, Poland
Registered: 2010-07-10
Posts: 28

[SOLVED] Vagrantfile setting up X GUI graphical mode Archlinux

I am looking for nice Vagrantfile that would setup official
https://app.vagrantup.com/archlinux/boxes/archlinux
archlinux image , to be ready to use graphical mode (X11/Xorg/Wayland/whatever will work well ) in VirtualBox (host is also Archlinux).
In past I had sometimes there are issues with VM integration (e.g. changing window size was not changing VM screen size automatically, or seamless window integration was out etc).

References:

* VirtualBox/Install Arch Linux as a guest https://wiki.archlinux.org/index.php/Vi … as_a_guest
* [SOLVED] install xorg on Virtualbox's ArchLinux https://bbs.archlinux.org/viewtopic.php?id=124383

Last edited by gwpl (2020-11-14 22:25:31)

Offline

#2 2020-10-19 23:00:02

gwpl
Member
From: Warsaw, Poland
Registered: 2010-07-10
Posts: 28

Re: [SOLVED] Vagrantfile setting up X GUI graphical mode Archlinux

UPDATED:

E.g. with following `Vagrantfile` :

$script = <<-'SCRIPT'
pacman --noconfirm -Syyu
pacman --noconfirm -S vim htop git hwinfo
pacman --noconfirm -R virtualbox-guest-utils-nox && pacman --noconfirm -S virtualbox-guest-{utils,dkms,iso}
pacman --noconfirm -S \
                      xorg-server{,-common,-xwayland} \
                      xorg-xinit \
                      xf86-video-{fbdev,vesa} \
                      xorg-xcalc xterm xrandr
date > /etc/vagrant_provisioned_at
gpasswd -a vagrant video
pacman --noconfirm -S fluxbox awesome && echo startfluxbox > /home/vagrant/.xinitrc
# if someone likes kde: pacman --noconfirm -S plasma-desktop konsole dolphin kscreen && echo startplasma-x11 > /home/vagrant/.xinitrc
chown vagrant:vagrant /home/vagrant/.xinitrc # it looks like at this stage there is no /home/vagrant, so making .xinitrc may be required to be done manually
pacman --noconfirm -S sddm
systemctl enable sddm
systemctl start sddm
SCRIPT

Vagrant.configure("2") do |config|
  config.vm.box = "archlinux/archlinux"
  config.vm.provider "virtualbox" do |v|
    # https://www.vagrantup.com/docs/providers/virtualbox/configuration
    v.gui = true
    v.name = "Archlinux_GUI"
    v.linked_clone = true
    v.check_guest_additions = true
    v.customize ["modifyvm", :id, "--cpuexecutioncap", "50"]
    v.customize ["modifyvm", :id, "--vram", "64"] #video ram in MB
    v.memory = 2048
    v.cpus = 2
  end
  config.vm.provision "shell", inline: $script
end

Works!

SOLUTION:

BEFORE installing virtualbox packages, you need to remove -nox one:

pacman --noconfirm -R virtualbox-guest-utils-nox && pacman --noconfirm -S virtualbox-guest-{utils,dkms,iso}

Last edited by gwpl (2020-11-14 22:29:51)

Offline

Board footer

Powered by FluxBB