Last active
June 12, 2024 08:44
-
-
Save gnthibault/457c40f3359c6b9f8ab3be58128f9bfd to your computer and use it in GitHub Desktop.
Install default setup in ubuntu when ran into UTM, qemu based virtualization
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Install prerequisites | |
sudo apt install -y ubuntu-desktop | |
sudo apt install -y qemu-guest-agent, spice-vdagent, spice-webdavd, davfs2 | |
# Check if spice vdagent is enabled to get right click/clipboard working through utm | |
sudo systemctl start spice-vdagent | |
sudo systemctl enable spice-vdagent | |
sudo systemctl status spice-vdagent | |
# If you want to use webdav (not recommanded) you can check if it is working with | |
# sudo systemctl start spice-webdavd.service | |
# sudo systemctl enable spice-webdavd.service | |
# sudo systemctl status spice-webdavd.service | |
# Check directory sharing through webdav, ie once SPICE WebDAV is installed and running, you should be able to access http://127.0.0.1:9843 from inside the guest. This is a WebDAV share that you can mount using something like davfs2. | |
# We'd rather use VirtFS, faster, and easier to setup (see https://docs.getutm.app/guest-support/linux/#virtfs) | |
mkdir /home/gnthibault/shared | |
sudo mount -t 9p -o trans=virtio share /home/gnthibault/shared -oversion=9p2000.L | |
# Automate with | |
echo "share /home/gnthibault/shared 9p trans=virtio,version=9p2000.L,rw,_netdev,nofail 0 0" | sudo tee -a /etc/fstab | |
sudo systemctl daemon-reload | |
sudo mount -a | |
sudo chown -R $USER /home/gnthibault/shared | |
# Extend disk | |
lsblk -p | |
sudo lvextend -l +100%FREE /dev/ubuntu-vg/ubuntu-lv | |
sudo resize2fs /dev/mapper/ubuntu--vg-ubuntu--lv |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment