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.


author

Authored By Amit Agarwal

Amit Agarwal, Linux and Photography are my hobbies.Creative Commons Attribution 4.0 International License.

We notice you're using an adblocker. If you like our webite please keep us running by whitelisting this site in your ad blocker. We’re serving quality, related ads only. Thank you!

I've whitelisted your website.

Not now
This website uses cookies to ensure you get the best experience on our website. Learn more Got it