User Tools

Site Tools


ubuntu:kvm:setup_kvm_with_bridged_networking_and_virt-manager

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
ubuntu:kvm:setup_kvm_with_bridged_networking_and_virt-manager [2019/12/26 17:35] – [Add Your User To The Groups] peterubuntu:kvm:setup_kvm_with_bridged_networking_and_virt-manager [2020/07/15 09:30] (current) – external edit 127.0.0.1
Line 97: Line 97:
     bridge_ports eth0     bridge_ports eth0
 </file> </file>
 +
 +or for a static IP address.
 +
 +<file bash /etc/network/interfaces>
 +auto lo br0
 +iface lo inet loopback
 +
 +auto ens33
 +iface ens33 inet manual
 +
 +auto br0
 +iface br0 inet static
 +        address 192.168.1.69
 +        netmask 255.255.255.0
 +        network 192.168.1.1
 +        broadcast 192.168.1.255
 +        gateway 192.168.1.1
 +        bridge_ports ens33
 +        bridge_stp off
 +        bridge_fd 0
 +        bridge_maxwait 0
 +        dns-nameservers 1.1.1.1
 +...
 +</file>
 +
  
 If netplan is used: If netplan is used:
Line 164: Line 189:
 </code> </code>
  
-To refresh or reload group membership:+---- 
 + 
 +===== Restart your system ===== 
 + 
 +That's the best way to ensure that both the networking and user changes take effect. 
 + 
 +Alternatively, to refresh or reload group membership:
  
 <code bash> <code bash>
Line 170: Line 201:
 newgrp libvirt-qemu newgrp libvirt-qemu
 </code> </code>
- 
  
 ---- ----
  
-===== Restart your system =====+===== Verify that the bridge has come up =====
  
-That'the best way to ensure that both the networking and user changes take effect.+<code bash> 
 +ip a br0 
 +</code>
  
 ---- ----
  
-====== Creating a VM ======+====== Create a VM using Virt-Manager (GUI) ======
  
 Use **virt-manager** to create VMs. Use **virt-manager** to create VMs.
Line 213: Line 245:
  
 ---- ----
 +
 +====== Create a VM from command line ======
 +
 +<code bash>
 +sudo virt-install \
 +  --name ubuntu-vm \
 +  --os-type linux \
 +  --os-variant ubuntu18.04 \
 +  --ram 2048 \
 +  --vcpu 1 \
 +  --disk path=/var/lib/libvirt/images/ubuntu-vm.qcow2,size=10 \
 +  --graphics vnc,listen=0.0.0.0 \
 +  --noautoconsole \
 +  --hvm \
 +  --cdrom /home/peter/vm/ubuntu-18.04-live-server-amd64.iso \
 +  --boot cdrom,hd
 +</code>
 +
 +----
 +
 +===== Find VNC display port for ubuntu-vm =====
 +
 +<code bash>
 +sudo virsh list --all
 +</code>
 +
 +returns:
 +
 +<code bash>
 +Id    Name          State
 +------------------------------
 +1     ubuntu-vm     running
 +2     debian-vm     running
 +...
 +</code>
 +
 +----
 +or
 +
 +<code bash>
 +sudo virsh vncdisplay ubuntu-vm
 +</code>
 +
 +returns:
 +
 +<code bash>
 +:0
 +</code>
 +
 +Connect using Remote Desktop Viewer using IP address and VNC port as "0".
 +
 +----
 +
  
 ====== Closing Thoughts ====== ====== Closing Thoughts ======
ubuntu/kvm/setup_kvm_with_bridged_networking_and_virt-manager.1577381714.txt.gz · Last modified: 2020/07/15 09:30 (external edit)

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki