Vagrant: add desktop to Vagrant
This commit is contained in:
parent
904b493809
commit
4020308d40
42
Tools/vagrant/initvagrant-desktop.sh
Normal file
42
Tools/vagrant/initvagrant-desktop.sh
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
echo "---------- $0 start ----------"
|
||||||
|
|
||||||
|
set -e
|
||||||
|
set -x
|
||||||
|
|
||||||
|
/vagrant/Tools/vagrant/initvagrant.sh
|
||||||
|
|
||||||
|
VAGRANT_USER=ubuntu
|
||||||
|
if [ -e /home/vagrant ]; then
|
||||||
|
# prefer vagrant user
|
||||||
|
VAGRANT_USER=vagrant
|
||||||
|
fi
|
||||||
|
|
||||||
|
apt-get update
|
||||||
|
|
||||||
|
apt-get install -y ubuntu-desktop
|
||||||
|
|
||||||
|
GDB_CONF="/etc/gdm3/custom.conf"
|
||||||
|
perl -pe 's/# AutomaticLoginEnable = true/AutomaticLoginEnable = true/' -i "$GDB_CONF"
|
||||||
|
perl -pe 's/# AutomaticLogin = user1/AutomaticLogin = vagrant/' -i "$GDB_CONF"
|
||||||
|
|
||||||
|
cat >>/etc/xdg/autostart/open-gnome-terminal.desktop <<EOF
|
||||||
|
[Desktop Entry]
|
||||||
|
Type=Application
|
||||||
|
Name=Start gnome terminal
|
||||||
|
TryExec=gnome-terminal
|
||||||
|
Exec=gnome-terminal
|
||||||
|
|
||||||
|
X-GNOME-Autostart-Phase=Application
|
||||||
|
EOF
|
||||||
|
|
||||||
|
# disable the screensaver:
|
||||||
|
sudo -u "$VAGRANT_USER" dbus-launch gsettings set org.gnome.desktop.session idle-delay 0
|
||||||
|
|
||||||
|
# don't show the initial setup crap:
|
||||||
|
echo "yes" | sudo -u "$VAGRANT_USER" dd of=/home/"$VAGRANT_USER"/.config/gnome-initial-setup-done
|
||||||
|
|
||||||
|
# start the graphical environment right now:
|
||||||
|
systemctl isolate graphical.target
|
||||||
|
|
||||||
|
echo "---------- $0 end ----------"
|
11
Vagrantfile
vendored
11
Vagrantfile
vendored
@ -167,6 +167,17 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
|
|||||||
focal.vm.boot_timeout = 1200
|
focal.vm.boot_timeout = 1200
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# 20.04 LTS
|
||||||
|
config.vm.define "focal-desktop", autostart: false do |focal|
|
||||||
|
focal.vm.box = "ubuntu/focal64"
|
||||||
|
focal.vm.provision :shell, path: "Tools/vagrant/initvagrant-desktop.sh"
|
||||||
|
focal.vm.provider "virtualbox" do |vb|
|
||||||
|
vb.name = "ArduPilot (focal-desktop)"
|
||||||
|
vb.gui = true
|
||||||
|
end
|
||||||
|
focal.vm.boot_timeout = 1500
|
||||||
|
end
|
||||||
|
|
||||||
# 20.10
|
# 20.10
|
||||||
config.vm.define "groovy", autostart: false do |groovy|
|
config.vm.define "groovy", autostart: false do |groovy|
|
||||||
groovy.vm.box = "ubuntu/groovy64"
|
groovy.vm.box = "ubuntu/groovy64"
|
||||||
|
Loading…
Reference in New Issue
Block a user