libvirt- Create virtual machine with text console only interface
2019-05-27
146 words
1 min read
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 🙂
virt-install --name test --os-variant=centos7 \ --description "CentOS 7.5 VM" --extra-args \ "ks=ks7.5.cfg console=ttyS0,115200n8 serial" --graphics none --console pty,target_type=serial \ --ram 60240 --vcpus 23 --disk path=/tmp/vm.qcow2,bus=virtio,size=20 \ --location /centos.iso --os-type=linux --hvm --accelerate \ --noautoconsole --wait=-1
Especifically for the no-graphical installation, I have added the following:
console=ttyS0,115200n8 serial — in extra-args
–graphics none
–console pty,target_type=serial
These options will enable installing the VM in a Text install mode and thus saving your day.
Related Articles:
- 2016/07/25 Install virtual machines in one line
- 2018/03/26 vagrant box to libvirtd (QEMU) VM
- 2017/05/22 Fix display size on libvirt/Qemu guest
- 2016/04/15 Most simple and fast lightweight container with Fedora systemd
- 2016/02/01 virsh – show ip address of all running VMs
Authored By Amit Agarwal
Amit Agarwal, Linux and Photography are my hobbies.Creative Commons Attribution 4.0 International License.