libvirt- Create virtual machine with text console only interface

2019-05-27 1 min read Linux Vurtualization
virt-install is an amazing tool to create VMs. If you have created a config file (Kickstart file – ks.cfg), then its only one line un-attended install. If you are using this on remote host with ssh and unluckily cannot export display – what do you do. Do a non-graphical install. There are only minor changes in the command to tell the installer that there is no graphics available and it is amazing, is it not 🙂 Continue reading

Linked clone with qemu-img

2018-04-09 2 min read Vurtualization
As you would have seen in Virtualbox or vmware, there is option to create a linked clone. I wanted to use the same feature as “Snapshot” feature anyway does not look/work so great with virt-manager. So, I created a script to create a linked clone VM and here it is : #!/bin/bash - #=============================================================================== # # FILE: qcow2-linked-clone.sh # # USAGE: ./qcow2-linked-clone.sh # # DESCRIPTION: # # OPTIONS: --- # REQUIREMENTS: --- # BUGS: --- # NOTES: --- # AUTHOR: Amit Agarwal (aka) # ORGANIZATION: Mobileum # CREATED: 01/05/2018 09:54 # Last modified: Wed Feb 28, 2018 04:39PM # REVISION: --- #=============================================================================== set -o nounset # Treat unset variables as an error UP=" Continue reading

vagrant box to libvirtd (QEMU) VM

2018-03-26 1 min read Fedora Vurtualization
Like ova images, you can use box images as well with Qemu. After all, both have the disk images, so here is the script to do that. Just put the script somewhere in your path and run with ova or box image name : #!/bin/bash - #=============================================================================== # # FILE: ova2vm.sh # # USAGE: ./ova2vm.sh # # DESCRIPTION: # # OPTIONS: --- # REQUIREMENTS: --- # BUGS: --- # NOTES: --- # AUTHOR: Amit Agarwal (aka), # ORGANIZATION: Mobileum # CREATED: 12/28/2017 13:59 # Last modified: Sun Mar 11, 2018 12:01PM # REVISION: --- #=============================================================================== set -o nounset # Treat unset variables as an error dest='/mnt/Backup/VM' ORIG=${PWD} if [[ $# == 0 ]] then echo " Continue reading

Add ova file as VM on Linux with libvirt (Qemu)

2018-02-12 1 min read Vurtualization
Although the commands are very simple and just 2-3 steps but I keep forgetting them and hence wrote the following script: The script takes input as “ova” filename and then creates the qcow2 image and finally a VM for you. #!/bin/bash - #=============================================================================== # # FILE: ova2vm.sh # # USAGE: ./ova2vm.sh # # DESCRIPTION: # # OPTIONS: --- # REQUIREMENTS: --- # BUGS: --- # NOTES: --- # AUTHOR: Amit Agarwal (aka), # ORGANIZATION: Mobileum # CREATED: 12/28/2017 13:59 # Last modified: Thu Dec 28, 2017 02:17PM # REVISION: --- #=============================================================================== set -o nounset # Treat unset variables as an error if [[ $# == 0 ]] then echo " Continue reading

Fix display size on libvirt/Qemu guest

2017-05-22 2 min read Learning Vurtualization
Lot of times I find myself of VM that does not correctly resize the screen display and that is literally nuisance. So, here is quick and dirty fix for this. First you need to find out information about your display with following command: xrandr -q And you will see output like this: Screen 0: minimum 320 x 200, current 1920 x 1080, maximum 8192 x 8192 Virtual-0 connected primary 1920×1080+0+0 0mm x 0mm Continue reading

Install virtual machines in one line

2016-07-25 1 min read Vurtualization
To install a VM from command line, you can use the following command. Change the required parameters as need but you need to change at-least CDROM iso image and disk-path. virt-install \ -n myVM \ --description "Test VM" \ --os-type=Linux \ --os-variant=centos7 \ --ram=2048 \ --vcpus=2 \ --disk path=./myVM.img,bus=virtio,size=10 \ --graphics none \ --cdrom <Image installtion CDROM>.iso \ --net user
Older posts