Editing VMs with virsh
Jump to navigation
Jump to search
To increase the memory size of a vm:
Power off the vm then (say to increase the memory on chi to 2GB):
virsh setmaxmem chi 2G --config virsh setmem chi 2G --config virsh start chi
View current virtual NICs of VM:
virsh domiflist <domain> -sh-4.1$ sudo virsh domiflist ldap-test-serv Interface Type Source Model MAC ------------------------------------------------------- vnet0 bridge br0 virtio 52:54:00:cd:3f:15
Use brctl show to view bridges you can connect your VM NIC to. Example:
-sh-4.1$ sudo brctl show bridge name bridge id STP enabled interfaces br0 8000.001e0bc689d6 no eth0 vnet0 vnet1 br1 8000.001e0bc689d7 no eth1 virbr0 8000.5254001021b8 yes virbr0-nic
Add a virtual NIC to a VM:
virsh attach-interface --domain <domain_name> --type bridge_id --source <source_device> --model virtio --mac <random_mac_address> --config --live ex: [root@vav networks]# virsh attach-interface --domain chronos --type bridge --source br1 --model virtio --mac 52:54:00:ab:cc:09 --config --live --config affects next startup of domain --live affects a running domain