Last active
December 29, 2023 07:09
-
-
Save msimonin/cb588671abc28a595cad to your computer and use it in GitHub Desktop.
install ubuntu on a virtual machine (libvirt / kvm)
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
# get the iso | |
wget http://releases.ubuntu.com/14.04.3/ubuntu-14.04.3-server-amd64.iso | |
# create the image disk | |
qemu-img create -f qcow2 disk.qcow2 10G | |
# launch the creation | |
virsh create ubuntu.xml | |
# you can connect to using vnc. |
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
# "external bridge" | |
ovs-vsctl add-br br0 && ovs-vsctl add-port br0 eth0 && ifconfig eth0 0.0.0.0 && dhclient br0 | |
# internal bridge | |
ovs-vsctl add-br br-int | |
# gre tunnel | |
ovs-vsctl add-port br-int gre0 -- set interface gre0 type=gre options:remote_ip=<remote ip> |
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
<domain type='kvm'> | |
<name>ubuntu</name> | |
<memory unit='GB'>2</memory> | |
<vcpu>1</vcpu> | |
<os> | |
<type arch='x86_64' machine='pc-0.12'>hvm</type> | |
<boot dev='cdrom'/> | |
</os> | |
<features> | |
<pae/> | |
<acpi/> | |
<apic/> | |
</features> | |
<clock sync="localtime"/> | |
<devices> | |
<emulator>/usr/bin/kvm</emulator> | |
<disk type='file' device='cdrom'> | |
<driver name='qemu' type='raw'/> | |
<source file='/tmp/ubuntu-14.04.3-server-amd64.iso'/> | |
<target dev='hdc' bus='ide'/> | |
<readonly/> | |
</disk> | |
<disk type='file' device='disk'> | |
<driver name='qemu' type='qcow2' cache='none'/> | |
<source file='/tmp/disk.qcow2'/> | |
<target dev='hda'/> | |
</disk> | |
<interface type='bridge'> | |
<source bridge='br0'/> | |
<virtualport type='openvswitch'/> | |
<model type='virtio' /> | |
</interface> | |
<graphics type='vnc' port='-1' autoport='yes' keymap='fr' listen='0.0.0.0' passwd='password'/> | |
</devices> | |
</domain> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment