Instalar VirtualBox Guest Additions

VirtualBox Guest Additions permite tener mayor control sobre tu máquina virtual por ejemplo: mayores resoluciones de video, control transparente del ratón y del teclado entre otras cosas.

Sigue estas instrucciones para instalar VirtualBox Guest Additions en tu máquina virtual corriendo: CentOS 8, ALMA Linux o Rocky Linux.

1. Necesitamos agregar el repositorio EPEL a nuestro sistema.

Linux console | jpacheco@aex-infra ~
[jpacheco@aex-infra ~]$ sudo yum -y install epel-release
Last metadata expiration check: 0:00:12 ago on Thu 23 Mar 2023 12:18:14 PM CDT.
Dependencies resolved.
================================================================================
Package Architecture Version Repository Size
================================================================================
Installing:
epel-release noarch 8-18.el8 epel 24 k

Transaction Summary
================================================================================

Total download size: 24 k
Installed size: 35 k
Downloading Packages:
epel-release-8-18.el8.noarch.rpm 164 kB/s | 24 kB 00:00
——————————————————————————–
Total 67 kB/s | 24 kB 00:00
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Running scriptlet: epel-release-8-18.el8.noarch 1/1
Reinstalling : epel-release-8-18.el8.noarch 1/2
Running scriptlet: epel-release-8-18.el8.noarch 1/2
Cleanup : epel-release-8-18.el8.noarch 2/2
Running scriptlet: epel-release-8-18.el8.noarch 2/2
Verifying : epel-release-8-18.el8.noarch 1/2
Verifying : epel-release-8-18.el8.noarch 2/2

Reinstalled:
epel-release-8-18.el8.noarch

Complete!

2. Actualizar los paquetes

Linux console | jpacheco@aex-infra ~
[jpacheco@aex-infra ~]$ sudo dnf -y update
Last metadata expiration check: 0:02:05 ago on Thu 23 Mar 2023 12:18:14 PM CDT.
Dependencies resolved.
================================================================================
Package Architecture Version Repository Size
================================================================================
Upgrading:
openssl x86_64 1:1.1.1k-9.el8_7 baseos 709 k
openssl-libs x86_64 1:1.1.1k-9.el8_7 baseos 1.5 M

Transaction Summary
================================================================================
Upgrade 2 Packages

Total download size: 2.2 M
Downloading Packages:
[MIRROR] openssl-libs-1.1.1k-9.el8_7.x86_64.rpm: Status code: 404 for https://rocky-linux-us-east1.production.gcp.mirrors.ctrliq.cloud/pub/rocky//8.7/BaseOS/x86_64/os/Packages/o/openssl-libs-1.1.1k-9.el8_7.x86_64.rpm (IP: 34.110.187.106)
(1/2): openssl-1.1.1k-9.el8_7.x86_64.rpm 3.1 MB/s | 709 kB 00:00
(2/2): openssl-libs-1.1.1k-9.el8_7.x86_64.rpm 1.5 MB/s | 1.5 MB 00:01
——————————————————————————–
Total 2.0 MB/s | 2.2 MB 00:01
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Upgrading : openssl-libs-1:1.1.1k-9.el8_7.x86_64 1/4
Running scriptlet: openssl-libs-1:1.1.1k-9.el8_7.x86_64 1/4
Upgrading : openssl-1:1.1.1k-9.el8_7.x86_64 2/4
Cleanup : openssl-1:1.1.1k-7.el8_6.x86_64 3/4
Cleanup : openssl-libs-1:1.1.1k-7.el8_6.x86_64 4/4
Running scriptlet: openssl-libs-1:1.1.1k-7.el8_6.x86_64 4/4
Verifying : openssl-1:1.1.1k-9.el8_7.x86_64 1/4
Verifying : openssl-1:1.1.1k-7.el8_6.x86_64 2/4
Verifying : openssl-libs-1:1.1.1k-9.el8_7.x86_64 3/4
Verifying : openssl-libs-1:1.1.1k-7.el8_6.x86_64 4/4

Upgraded:
openssl-1:1.1.1k-9.el8_7.x86_64 openssl-libs-1:1.1.1k-9.el8_7.x86_64

Complete!

3. Instalar dependencias

Linux console | jpacheco@aex-infra ~
[jpacheco@aex-infra ~]$ sudo dnf -y install make gcc kernel-headers kernel-devel perl dkms bzip2
Last metadata expiration check: 0:07:21 ago on Thu 23 Mar 2023 12:18:14 PM CDT.
Dependencies resolved.
=======================================================================================================================================
Package Architecture Version Repository Size
=======================================================================================================================================
Reinstalling:
bzip2 x86_64 1.0.6-26.el8 baseos 59 k
dkms noarch 3.0.10-1.el8 epel 89 k
elfutils-libelf-devel x86_64 0.187-4.el8 baseos 60 k
gcc x86_64 8.5.0-16.el8_7 appstream 23 M
kernel-devel x86_64 4.18.0-425.13.1.el8_7 baseos 22 M
kernel-headers x86_64 4.18.0-425.13.1.el8_7 baseos 10 M
make x86_64 1:4.2.1-11.el8 baseos 497 k
perl x86_64 4:5.26.3-421.el8 appstream 72 k

Transaction Summary
=======================================================================================================================================

Total download size: 57 M
Installed size: 118 M
Downloading Packages:
(1/8): perl-5.26.3-421.el8.x86_64.rpm 384 kB/s | 72 kB 00:00
(2/8): bzip2-1.0.6-26.el8.x86_64.rpm 252 kB/s | 59 kB 00:00
(3/8): elfutils-libelf-devel-0.187-4.el8.x86_64.rpm 387 kB/s | 60 kB 00:00
(4/8): kernel-headers-4.18.0-425.13.1.el8_7.x86_64.rpm 2.9 MB/s | 10 MB 00:03
(5/8): make-4.2.1-11.el8.x86_64.rpm 2.5 MB/s | 497 kB 00:00
(6/8): dkms-3.0.10-1.el8.noarch.rpm 344 kB/s | 89 kB 00:00
(7/8): kernel-devel-4.18.0-425.13.1.el8_7.x86_64.rpm 2.4 MB/s | 22 MB 00:09
(8/8): gcc-8.5.0-16.el8_7.x86_64.rpm 2.1 MB/s | 23 MB 00:11
—————————————————————————————————————————————
Total 4.8 MB/s | 57 MB 00:11
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Running scriptlet: elfutils-libelf-devel-0.187-4.el8.x86_64 1/1
Reinstalling : elfutils-libelf-devel-0.187-4.el8.x86_64 1/16
Reinstalling : gcc-8.5.0-16.el8_7.x86_64 2/16
Running scriptlet: gcc-8.5.0-16.el8_7.x86_64 2/16
Reinstalling : kernel-devel-4.18.0-425.13.1.el8_7.x86_64 3/16
Running scriptlet: kernel-devel-4.18.0-425.13.1.el8_7.x86_64 3/16
Reinstalling : make-1:4.2.1-11.el8.x86_64 4/16
Running scriptlet: make-1:4.2.1-11.el8.x86_64 4/16
Reinstalling : dkms-3.0.10-1.el8.noarch 5/16
Running scriptlet: dkms-3.0.10-1.el8.noarch 5/16
Reinstalling : kernel-headers-4.18.0-425.13.1.el8_7.x86_64 6/16
Reinstalling : bzip2-1.0.6-26.el8.x86_64 7/16
Reinstalling : perl-4:5.26.3-421.el8.x86_64 8/16
Running scriptlet: dkms-3.0.10-1.el8.noarch 9/16
Cleanup : dkms-3.0.10-1.el8.noarch 9/16
Running scriptlet: dkms-3.0.10-1.el8.noarch 9/16
Cleanup : kernel-devel-4.18.0-425.13.1.el8_7.x86_64 10/16
Cleanup : elfutils-libelf-devel-0.187-4.el8.x86_64 11/16
Cleanup : kernel-headers-4.18.0-425.13.1.el8_7.x86_64 12/16
Cleanup : perl-4:5.26.3-421.el8.x86_64 13/16
Running scriptlet: gcc-8.5.0-16.el8_7.x86_64 14/16
Cleanup : gcc-8.5.0-16.el8_7.x86_64 14/16
Running scriptlet: make-1:4.2.1-11.el8.x86_64 15/16
Cleanup : make-1:4.2.1-11.el8.x86_64 15/16
Cleanup : bzip2-1.0.6-26.el8.x86_64 16/16
Running scriptlet: bzip2-1.0.6-26.el8.x86_64 16/16
Verifying : gcc-8.5.0-16.el8_7.x86_64 1/16
Verifying : gcc-8.5.0-16.el8_7.x86_64 2/16
Verifying : perl-4:5.26.3-421.el8.x86_64 3/16
Verifying : perl-4:5.26.3-421.el8.x86_64 4/16
Verifying : bzip2-1.0.6-26.el8.x86_64 5/16
Verifying : bzip2-1.0.6-26.el8.x86_64 6/16
Verifying : elfutils-libelf-devel-0.187-4.el8.x86_64 7/16
Verifying : elfutils-libelf-devel-0.187-4.el8.x86_64 8/16
Verifying : kernel-devel-4.18.0-425.13.1.el8_7.x86_64 9/16
Verifying : kernel-devel-4.18.0-425.13.1.el8_7.x86_64 10/16
Verifying : kernel-headers-4.18.0-425.13.1.el8_7.x86_64 11/16
Verifying : kernel-headers-4.18.0-425.13.1.el8_7.x86_64 12/16
Verifying : make-1:4.2.1-11.el8.x86_64 13/16
Verifying : make-1:4.2.1-11.el8.x86_64 14/16
Verifying : dkms-3.0.10-1.el8.noarch 15/16
Verifying : dkms-3.0.10-1.el8.noarch 16/16

Reinstalled:
bzip2-1.0.6-26.el8.x86_64 dkms-3.0.10-1.el8.noarch elfutils-libelf-devel-0.187-4.el8.x86_64
gcc-8.5.0-16.el8_7.x86_64 kernel-devel-4.18.0-425.13.1.el8_7.x86_64 kernel-headers-4.18.0-425.13.1.el8_7.x86_64
make-1:4.2.1-11.el8.x86_64 perl-4:5.26.3-421.el8.x86_64

Complete!

4. Exportar KERN_DIR

Linux console | jpacheco@aex-infra ~
[jpacheco@aex-infra ~]$ sudo export KERN_DIR=/usr/src/kernels/$(uname -r)

5. Reinciar la máquina virtual y listo.

Linux console | jpacheco@aex-infra ~
[jpacheco@aex-infra ~]$ sudo reboot

About javier

Mexicano, Ingeniero en Sistemas egresado del Instituto Tecnológico de Durango, Maestro en Software Libre por la Universidad Autónoma de Chihuahua. Apasionado de medio tiempo de la fotografía y guitarrista de closet.
This entry was posted in Blog. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *