instalar-un-gestor-de-maquinas-virtuales-en-hyperbola-gnulinux-libre: libvirt removed package for unresovable dependencies towards D-Bus
Ref: https://git.hyperbola.info:50100/~team/packages/extra.git/commit/?h=throgh&id=ae8e7d0925b110f1cafc436481bb85efc42ade11
This commit is contained in:
parent
dae6660545
commit
d177691118
@ -31,14 +31,9 @@ In totally free operating systems there is a program
|
|||||||
called `qemu` that allows us to virtualize.
|
called `qemu` that allows us to virtualize.
|
||||||
|
|
||||||
[Qemu][qemu]{:target="_blank" rel="noopener noreferrer"}
|
[Qemu][qemu]{:target="_blank" rel="noopener noreferrer"}
|
||||||
works through the command line, but there are
|
works through the command line.
|
||||||
also GUIs.
|
|
||||||
|
|
||||||
In this guide we explain how to install
|
## Enable virtualization
|
||||||
[Virtual Machine Manager][vm]{:target="_blank" rel="noopener noreferrer"}
|
|
||||||
which is very complete when virtualizing operating systems.
|
|
||||||
|
|
||||||
## Virtual Machine Manager installation
|
|
||||||
|
|
||||||
### Check if your PC supports virtualization
|
### Check if your PC supports virtualization
|
||||||
|
|
||||||
@ -54,24 +49,15 @@ If your computer supports virtualization, you should see the
|
|||||||
output as `Virtualization: VT-x` or `Virtualization: AMD-V`,
|
output as `Virtualization: VT-x` or `Virtualization: AMD-V`,
|
||||||
otherwise your computer is not capable of virtualizing.
|
otherwise your computer is not capable of virtualizing.
|
||||||
|
|
||||||
### Virtual Machine Manager Installing
|
### Qemu Installing
|
||||||
|
|
||||||
:::console
|
:::console
|
||||||
# pacman -Sy
|
# pacman -Sy
|
||||||
|
|
||||||
# pacman -S virt-manager qemu vde2 dnsmasq bridge-utils libvirt
|
# pacman -S qemu vde2 dnsmasq bridge-utils
|
||||||
|
|
||||||
# gpasswd -a <your-user> kvm
|
# gpasswd -a <your-user> kvm
|
||||||
|
|
||||||
# gpasswd -a <your-user> libvirt
|
|
||||||
|
|
||||||
### Check kvm group
|
|
||||||
|
|
||||||
:::console
|
|
||||||
# grep -E 'group="kvm"|group="78"' /etc/libvirt/qemu.conf
|
|
||||||
|
|
||||||
Check if there is `group="kvm"` or `group="78"`
|
|
||||||
|
|
||||||
### Enable kernel modules for virtualization
|
### Enable kernel modules for virtualization
|
||||||
|
|
||||||
- kvm_intel module (Intel processors)
|
- kvm_intel module (Intel processors)
|
||||||
@ -84,35 +70,6 @@ Check if there is `group="kvm"` or `group="78"`
|
|||||||
:::console
|
:::console
|
||||||
# modprobe kvm_amd
|
# modprobe kvm_amd
|
||||||
|
|
||||||
### Verify that the virtual machine is configured correctly
|
|
||||||
|
|
||||||
:::console
|
|
||||||
$ virt-host-validate
|
|
||||||
|
|
||||||
### Services
|
|
||||||
|
|
||||||
Virt-Manager relies on `libvirtd` services to function.
|
|
||||||
|
|
||||||
Here we explain how to start these service:
|
|
||||||
|
|
||||||
#### Start libvirtd
|
|
||||||
|
|
||||||
:::console
|
|
||||||
# rc-service libvirtd start
|
|
||||||
|
|
||||||
#### Add libvirtd for default
|
|
||||||
|
|
||||||
:::console
|
|
||||||
# rc-update add libvirtd default
|
|
||||||
|
|
||||||
#### Remove Service
|
|
||||||
|
|
||||||
If you want to remove the service and start
|
|
||||||
only when you want, run:
|
|
||||||
|
|
||||||
:::console
|
|
||||||
# rc-update del libvirtd default
|
|
||||||
|
|
||||||
### Enable nested virtualization in KVM
|
### Enable nested virtualization in KVM
|
||||||
|
|
||||||
Nested virtualization allows you to run a virtual machine (VM)
|
Nested virtualization allows you to run a virtual machine (VM)
|
||||||
@ -175,6 +132,55 @@ For example:
|
|||||||
----------------------------------
|
----------------------------------
|
||||||
options kvm_intel nested=1
|
options kvm_intel nested=1
|
||||||
|
|
||||||
|
## Qemu usage
|
||||||
|
|
||||||
|
Make virtual disk to use Virtual Machine.
|
||||||
|
|
||||||
|
:::console
|
||||||
|
$ qemu-img create hyper.qcow2 10G
|
||||||
|
|
||||||
|
### Simple usage
|
||||||
|
|
||||||
|
:::bash
|
||||||
|
#!/bin/bash
|
||||||
|
qemu-system-x86_64 \
|
||||||
|
-monitor stdio \
|
||||||
|
--enable-kvm -m 512 \
|
||||||
|
-cdrom $HOME/Descargas/hyperbola-milky-way-v0.4-dual.iso \
|
||||||
|
-drive file=$HOME/Descargas/hyper.qcow2,if=virtio \
|
||||||
|
-boot c -rtc base=localtime \
|
||||||
|
-device virtio-keyboard-pci \
|
||||||
|
-net nic -net user \
|
||||||
|
-vga virtio
|
||||||
|
|
||||||
|
`-net user` is important to have internet access within your new system.
|
||||||
|
`-m 512` is the set virtual RAM size (megabytes), default is 128 MB,
|
||||||
|
I chose 512
|
||||||
|
|
||||||
|
### Qemu + VNC as server
|
||||||
|
|
||||||
|
:::bash
|
||||||
|
#!/bin/bash
|
||||||
|
qemu-system-x86_64 \
|
||||||
|
-monitor stdio \
|
||||||
|
--enable-kvm -m 512 \
|
||||||
|
-cdrom /path/to/hyperbola-milky-way-v0.4-dual.iso \
|
||||||
|
-drive file=/path/to/hyper.qcow2,if=virtio \
|
||||||
|
-boot c -rtc base=localtime \
|
||||||
|
-device virtio-keyboard-pci \
|
||||||
|
-net nic -net user \
|
||||||
|
-vga virtio \
|
||||||
|
-display none \
|
||||||
|
-vnc :0
|
||||||
|
|
||||||
|
One can add the -vnc :X option to have QEMU redirect the VGA display to
|
||||||
|
the VNC session. Substitute X for the number of the display (0 will
|
||||||
|
then listen on 5900, 1 on 5901, 2 on 5902, etc).
|
||||||
|
|
||||||
|
>Warning: The default VNC server setup does not use any form of
|
||||||
|
>authentication. Any user can connect from any host.
|
||||||
|
> Maybe check: https://wiki.archlinux.org/title/QEMU#Basic_password_authentication
|
||||||
|
|
||||||
### Virtual Machine Manager screenshots
|
### Virtual Machine Manager screenshots
|
||||||
|
|
||||||
<figure>
|
<figure>
|
||||||
@ -209,5 +215,3 @@ this module comes disabled.
|
|||||||
[trisquel]: https://trisquel.info
|
[trisquel]: https://trisquel.info
|
||||||
[qemu]: https://wiki.qemu.org/Main_Page
|
[qemu]: https://wiki.qemu.org/Main_Page
|
||||||
[spectre]: https://www.kernel.org/doc/html/latest/admin-guide/hw-vuln/l1tf.html
|
[spectre]: https://www.kernel.org/doc/html/latest/admin-guide/hw-vuln/l1tf.html
|
||||||
[vm]: https://virt-manager.org/
|
|
||||||
*[GUI]: Graphical user interface
|
|
||||||
|
@ -30,15 +30,9 @@ En los sistemas operativos totalmente libres existe un
|
|||||||
programa llamado `qemu` que nos permite virtualizar.
|
programa llamado `qemu` que nos permite virtualizar.
|
||||||
|
|
||||||
[Qemu][qemu]{:target="_blank" rel="noopener noreferrer"}
|
[Qemu][qemu]{:target="_blank" rel="noopener noreferrer"}
|
||||||
funciona a través de línea de comandos, pero también
|
funciona a través de línea de comandos.
|
||||||
existen GUI, que como su nombre indica son interfaces
|
|
||||||
gráficas para el usuario.
|
|
||||||
|
|
||||||
En esta guía explicamos cómo instalar
|
## Habilitando la Virtualización
|
||||||
[Virtual Machine Manager][vm]{:target="_blank" rel="noopener noreferrer"}
|
|
||||||
el cual es muy completo al momento de virtualizar sistemas operativos.
|
|
||||||
|
|
||||||
## Instalación de Virtual Machine Manager
|
|
||||||
|
|
||||||
### Revisar si su PC soporta virtualización
|
### Revisar si su PC soporta virtualización
|
||||||
|
|
||||||
@ -54,24 +48,15 @@ Si su computadora admite virtualización, debería ver
|
|||||||
la salida como `Virtualización: VT-x` o `Virtualización: AMD-V`,
|
la salida como `Virtualización: VT-x` o `Virtualización: AMD-V`,
|
||||||
caso contrario su ordenador no es capaz de virtualizar.
|
caso contrario su ordenador no es capaz de virtualizar.
|
||||||
|
|
||||||
### Instalando Virtual Machine Manager
|
### Instalando qemu
|
||||||
|
|
||||||
:::console
|
:::console
|
||||||
# pacman -Sy
|
# pacman -Sy
|
||||||
|
|
||||||
# pacman -S virt-manager qemu vde2 dnsmasq bridge-utils libvirt
|
# pacman -S qemu vde2 dnsmasq bridge-utils
|
||||||
|
|
||||||
# gpasswd -a <tu-usuario> kvm
|
# gpasswd -a <tu-usuario> kvm
|
||||||
|
|
||||||
# gpasswd -a <tu-usuario> libvirt
|
|
||||||
|
|
||||||
### Revisar el grupo kvm
|
|
||||||
|
|
||||||
:::console
|
|
||||||
# grep -E 'group="kvm"|group="78"' /etc/libvirt/qemu.conf
|
|
||||||
|
|
||||||
Comprobar si existe `group="kvm"` o `group="78"`
|
|
||||||
|
|
||||||
### Habilitar módulos del kernel para virtualización
|
### Habilitar módulos del kernel para virtualización
|
||||||
|
|
||||||
- Módulo kvm_intel (procesadores Intel)
|
- Módulo kvm_intel (procesadores Intel)
|
||||||
@ -84,35 +69,6 @@ Comprobar si existe `group="kvm"` o `group="78"`
|
|||||||
:::console
|
:::console
|
||||||
# modprobe kvm_amd
|
# modprobe kvm_amd
|
||||||
|
|
||||||
### Verifique que la máquina virtual este configurada correctamente
|
|
||||||
|
|
||||||
:::console
|
|
||||||
$ virt-host-validate
|
|
||||||
|
|
||||||
### Servicios
|
|
||||||
|
|
||||||
Virt-Manager depende del servicio `libvirtd` para funcionar.
|
|
||||||
|
|
||||||
A continuación le explicamos cómo inciar ese servicio:
|
|
||||||
|
|
||||||
#### Iniciar libvirtd
|
|
||||||
|
|
||||||
:::console
|
|
||||||
# rc-service libvirtd start
|
|
||||||
|
|
||||||
#### Agregar libvirtd por defecto
|
|
||||||
|
|
||||||
:::console
|
|
||||||
# rc-update add libvirtd default
|
|
||||||
|
|
||||||
#### Quitar Servicio
|
|
||||||
|
|
||||||
Si desea quitar el servicio e iniciar solo cuando
|
|
||||||
usted desee, ejecute:
|
|
||||||
|
|
||||||
:::console
|
|
||||||
# rc-update del libvirtd default
|
|
||||||
|
|
||||||
### Habilitar la virtualización anidada en KVM
|
### Habilitar la virtualización anidada en KVM
|
||||||
|
|
||||||
La virtualización anidada le permite ejecutar una máquina virtual (VM)
|
La virtualización anidada le permite ejecutar una máquina virtual (VM)
|
||||||
@ -176,6 +132,58 @@ Por ejemplo:
|
|||||||
----------------------------------
|
----------------------------------
|
||||||
options kvm_amd nested=1
|
options kvm_amd nested=1
|
||||||
|
|
||||||
|
## Uso de Qemu
|
||||||
|
|
||||||
|
Escribir el disco virtual a usar por la máquina virtual.
|
||||||
|
|
||||||
|
:::console
|
||||||
|
$ qemu-img create hyper.qcow2 10G
|
||||||
|
|
||||||
|
### Uso simple:
|
||||||
|
|
||||||
|
:::bash
|
||||||
|
#!/bin/bash
|
||||||
|
qemu-system-x86_64 \
|
||||||
|
-monitor stdio \
|
||||||
|
--enable-kvm -m 512 \
|
||||||
|
-cdrom /path/to/hyperbola-milky-way-v0.4-dual.iso \
|
||||||
|
-drive file=/path/to/hyper.qcow2,if=virtio \
|
||||||
|
-boot c -rtc base=localtime \
|
||||||
|
-device virtio-keyboard-pci \
|
||||||
|
-net nic \
|
||||||
|
-net user \
|
||||||
|
-vga virtio
|
||||||
|
|
||||||
|
`-net user` es importante para tener acceso a Internet dentro
|
||||||
|
de su nuevo sistema. `-m 512` es el tamaño de RAM virtual
|
||||||
|
establecido (megabytes), el valor predeterminado es 128 MB,
|
||||||
|
elegí 512.
|
||||||
|
|
||||||
|
### Qemu + VNC como servidor
|
||||||
|
|
||||||
|
:::bash
|
||||||
|
#!/bin/bash
|
||||||
|
qemu-system-x86_64 \
|
||||||
|
-monitor stdio \
|
||||||
|
--enable-kvm -m 512 \
|
||||||
|
-cdrom /path/to/hyperbola-milky-way-v0.4-dual.iso \
|
||||||
|
-drive file=/path/to/hyper.qcow2,if=virtio \
|
||||||
|
-boot c -rtc base=localtime \
|
||||||
|
-device virtio-keyboard-pci \
|
||||||
|
-net nic -net user \
|
||||||
|
-vga virtio \
|
||||||
|
-display none \
|
||||||
|
-vnc :0
|
||||||
|
|
||||||
|
Se puede agregar la opción -vnc :X para que QEMU redirija la pantalla VGA a la sesión VNC.
|
||||||
|
Sustituya X por el número de la pantalla (0 entonces escuchará en 5900, 1 en 5901,
|
||||||
|
2 en 5902, etc).
|
||||||
|
|
||||||
|
>Advertencia: la configuración predeterminada del servidor VNC no
|
||||||
|
>utiliza ninguna forma de autenticación. Cualquier usuario puede
|
||||||
|
>conectarse desde cualquier host.
|
||||||
|
> Puedes revisar: https://wiki.archlinux.org/title/QEMU#Basic_password_authentication
|
||||||
|
|
||||||
### Capturas de pantalla de Virtual Machine Manager
|
### Capturas de pantalla de Virtual Machine Manager
|
||||||
|
|
||||||
<figure>
|
<figure>
|
||||||
@ -210,5 +218,3 @@ viene desactivado.
|
|||||||
[trisquel]: https://trisquel.info
|
[trisquel]: https://trisquel.info
|
||||||
[qemu]: https://wiki.qemu.org/Main_Page
|
[qemu]: https://wiki.qemu.org/Main_Page
|
||||||
[spectre]: https://www.kernel.org/doc/html/latest/admin-guide/hw-vuln/l1tf.html
|
[spectre]: https://www.kernel.org/doc/html/latest/admin-guide/hw-vuln/l1tf.html
|
||||||
[vm]: https://virt-manager.org/
|
|
||||||
*[GUI]: Graphical user interface
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user