Skip to content

Instantly share code, notes, and snippets.

@rajula96reddy
Last active July 8, 2018 18:04
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rajula96reddy/a9065c75d0b7c1b9f5472e0d480f31eb to your computer and use it in GitHub Desktop.
Save rajula96reddy/a9065c75d0b7c1b9f5472e0d480f31eb to your computer and use it in GitHub Desktop.

Installing & Using KVM on Linux One CC and SLES12SP3

Installing KVM

  1. Create a Linux One Community Cloud Account
  2. Create an instance using a key pair
  3. Start the instance
  4. SSH to the instance using the command ssh -i key.pem linux1@<ip>
  5. Get root privileges using the command sudo -i
  6. Install KVM tools and server using the command zypper in -t pattern kvm_server kvm_tools
  7. Start libvirtd using the command systemctl start libvirtd.service
  8. To verify installation run the command virsh list --all, this should return nothing as we did not create any VM as of now
  9. On your host system (your workspace machine you use, to access the cloud server), install the GUI manager Virtual Machine Manager or virt-manager using the command sudo apt-get install virt-manager
  10. Give appropriate permissions using the command usermod -G libvirt <username> (here username = linux1)

Setting Up

  1. From your host system, try connecting to the linux1 hypervisor using the command virsh -c qemu+ssh://linux1@<ip>/system?keyfile=<Key path> list. This will return the same as that of step 8 of installation.
  2. To simply the above command, go to the path ~/.config/libvirt/libvrit.conf, if the path doesn't exist create the path. In that file add the below contentsuri_aliases=[ "l1cc=qemu+ssh://linux1@<ip>/system?keyfile=<Key path>", ]The alias word 'l1cc' can be changed anything upto the user
  3. Now you can run the virsh .. command as virsh -c l`cc list
  4. To get the GUI run virt-manager -c l1cc. Given some time, remote hypervisor will be connected from your host machine
  5. Use the GUI, to first create a network, storage and then start a VM.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment