details guest additions

This commit is contained in:
waldek 2022-02-18 15:19:30 +01:00
parent 3cd63a682c
commit cbd2cd1f00
3 changed files with 101 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 269 KiB

View File

@ -247,3 +247,104 @@ Minimal means **no graphical environment**.
I advise you to **not** set a root password. I advise you to **not** set a root password.
Once this machine is up and running, install a few programs. Once this machine is up and running, install a few programs.
The only one we saw up until now is `htop` but maybe try out `bmon`, `elinks` and/or `ranger`. The only one we saw up until now is `htop` but maybe try out `bmon`, `elinks` and/or `ranger`.
## Guest additions
Let's make our user experience a bit nicer.
Virtual machines can *integrate* with the host machine more fluently when you install the guest additions in the VM.
It's a three step process.
1. install the required packages to build the guest additions in you VM
1. insert the guest additions CD into your VM
1. run the correct script from the CD
The dependencies can be installed as follows.
First you `update` your package list, next you install three packages.
* `build-essential`
* `dkms`
* `linux-headers-$(uname -r)`
The *third* package name is a bit weird looking no?
This is a bit of command line kung fu.
The actual *name* of the package is as follows.
```
waldek@hellodebian:~$ echo linux-headers-$(uname -r)
linux-headers-5.10.0-11-amd64
waldek@hellodebian:~$
```
The `$(uname -r)` is a call to a program called `uname` with the option `-r`.
We'll go more into detail on this later.
```
waldek@hellodebian:~$ sudo apt update
Hit:1 http://deb.debian.org/debian bullseye InRelease
Hit:2 http://deb.debian.org/debian bullseye-updates InRelease
Hit:3 http://security.debian.org/debian-security bullseye-security InRelease
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
All packages are up to date.
waldek@hellodebian:~$ sudo apt install build-essential dkms linux-headers-$(uname -r)
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
binutils binutils-common binutils-x86-64-linux-gnu dctrl-tools dpkg-dev fakeroot g++ g++-10 gcc gcc-10 libalgorithm-diff-perl
libalgorithm-diff-xs-perl libalgorithm-merge-perl libasan6 libatomic1 libbinutils libc-dev-bin libc-devtools libc6-dev libcc1-0 libcrypt-dev
libctf-nobfd0 libctf0 libfakeroot libgcc-10-dev libitm1 liblsan0 libnsl-dev libstdc++-10-dev libtirpc-dev libtsan0 libubsan1
linux-compiler-gcc-10-x86 linux-headers-5.10.0-11-common linux-headers-amd64 linux-kbuild-5.10 linux-libc-dev make manpages-dev patch
Suggested packages:
binutils-doc debtags debian-keyring g++-multilib g++-10-multilib gcc-10-doc gcc-multilib autoconf automake libtool flex bison gdb gcc-doc
gcc-10-multilib gcc-10-locales glibc-doc libstdc++-10-doc make-doc ed diffutils-doc
The following NEW packages will be installed:
binutils binutils-common binutils-x86-64-linux-gnu build-essential dctrl-tools dkms dpkg-dev fakeroot g++ g++-10 gcc gcc-10 libalgorithm-diff-perl
libalgorithm-diff-xs-perl libalgorithm-merge-perl libasan6 libatomic1 libbinutils libc-dev-bin libc-devtools libc6-dev libcc1-0 libcrypt-dev
libctf-nobfd0 libctf0 libfakeroot libgcc-10-dev libitm1 liblsan0 libnsl-dev libstdc++-10-dev libtirpc-dev libtsan0 libubsan1
linux-compiler-gcc-10-x86 linux-headers-5.10.0-11-amd64 linux-headers-5.10.0-11-common linux-headers-amd64 linux-kbuild-5.10 linux-libc-dev make
manpages-dev patch
0 upgraded, 43 newly installed, 0 to remove and 0 not upgraded.
Need to get 62.0 MB of archives.
After this operation, 258 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
```
Once this is done we can **insert** the CD.
You can verify the disk's content via the files explorer in gnome.
![CD](../assets/VirtualBox_debian_18_02_2022_15_01_18.png)
Now, open a terminal and run the following.
```
waldek@hellodebian:/media/cdrom0$ cd /media/cdrom0/
waldek@hellodebian:/media/cdrom0$ ls
AUTORUN.INF NT3x TRANS.TBL VBoxLinuxAdditions.run VBoxWindowsAdditions.exe
autorun.sh OS2 VBoxDarwinAdditions.pkg VBoxSolarisAdditions.pkg VBoxWindowsAdditions-x86.exe
cert runasroot.sh VBoxDarwinAdditionsUninstall.tool VBoxWindowsAdditions-amd64.exe
waldek@hellodebian:/media/cdrom0$ sudo bash VBoxLinuxAdditions.run
Verifying archive integrity... All good.
Uncompressing VirtualBox 6.1.28 Guest Additions for Linux........
VirtualBox Guest Additions installer
Copying additional installer modules ...
Installing additional modules ...
VirtualBox Guest Additions: Starting.
VirtualBox Guest Additions: Building the VirtualBox Guest Additions kernel
modules. This may take a while.
VirtualBox Guest Additions: To build modules for other installed kernels, run
VirtualBox Guest Additions: /sbin/rcvboxadd quicksetup <version>
VirtualBox Guest Additions: or
VirtualBox Guest Additions: /sbin/rcvboxadd quicksetup all
VirtualBox Guest Additions: Building the modules for kernel 5.10.0-11-amd64.
update-initramfs: Generating /boot/initrd.img-5.10.0-11-amd64
VirtualBox Guest Additions: Running kernel modules will not be replaced until
the system is restarted
waldek@hellodebian:/media/cdrom0$ sudo reboot now
```
Once the machine is rebooted you'll can resize the window and the screen resolution will adapt automatically!
You can also enable copy/paste and drag and drop between your host and VM now.
![full screen](../assets/VirtualBox_debian_18_02_2022_15_08_01.png)