How to install VirtualBox Guest Additions in ubuntu server 22.04 in terminal

Add you ~/.ssh/id_ed25519.pub key into ~/.ssh/authorized_keys, so you can use root@xx.xx.xx.xx


sudo mount /dev/cdrom /media
cd /media
sudo apt install bzip2
sudo ./VBoxLinuxAdditions.run
sudo reboot

Then mount your host folder into guest os folder by using User Interface.

Enjoy the life with virtualbox.