Last active
June 22, 2021 05:59
-
-
Save kekyo/0bc92b53b2cf336df2c7a09896ffdd12 to your computer and use it in GitHub Desktop.
Configure cockpit virtual machines on Ubuntu 20.04
This file contains hidden or 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
# /etc/netplan/00-installer-config.yaml | |
network: | |
ethernets: | |
enp0s1: | |
dhcp4: false | |
dhcp6: false | |
bridges: | |
br0: | |
interfaces: [ enp0s1 ] | |
addresses: [192.168.0.104/24] | |
gateway4: 192.168.0.1 | |
nameservers: | |
addresses: [8.8.8.8,8.8.4.4] | |
dhcp4: no | |
dhcp6: no | |
version: 2 |
This file contains hidden or 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
<network> | |
<name>host-bridge</name> | |
<forward mode="bridge"/> | |
<bridge name="br0"/> | |
</network> |
This file contains hidden or 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/sh | |
# The cockpit virtual machine pages on Ubuntu 20.04 may have many bugs, | |
# we'll receive un-understandable troubles... | |
# Configure network bridge dodges failure connections: | |
# https://levelup.gitconnected.com/how-to-setup-bridge-networking-with-kvm-on-ubuntu-20-04-9c560b3e3991 | |
virsh net-destroy default | |
virsh net-undefine default | |
virsh net-define host-bridge.xml | |
virsh net-start host-bridge | |
virsh net-autostart host-bridge | |
# Build virtual machine disk dodges a bug for cockpit VM pages on Ubuntu 20.04. | |
# Damn it causes unattachable storage configuration over storage pool/volume. | |
# The example makes with FILE reference configuraton manually... | |
qemu-img create -f qcow2 windows-server-2019.qcow2 128G | |
virsh attach-device windows-server-2019 windows-server-2019.qcow2.xml --config |
This file contains hidden or 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
<disk type='file' device='disk'> | |
<driver name='qemu' type='qcow2'/> | |
<source file='/storage/vms/windows-server-2019.qcow2'/> | |
<target dev='vdc' bus='sata'/> | |
</disk> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment