0

KVM newbie here, so be tolerant plz. I am trying to install a guest OS in a minimal installation of Centos7. I've been looking for tutorials around the web but all seem to be using a graphical host with VMM (Virtual Machine manager).

My minimal server does not have a graphical interface and obviously no VMM installed. So, how do I install a guest in host with no graphical interface ? What is the cli alternative for VMM? How am I supposed to render the graphical installation wizard ?

My intention here is to get the big picture of the entire process. Thanks.

2
1

KVM (or, rather, qemu, which provides the emulated devices inside the VM) can provide an emulated keyboard/mouse/screen over VNC. That will allow you to interact with the VM's console as though it were a physical machine you were sitting in front of.

0
0

Well, I was able to figure it out. Follow these simple steps to install a VM in a minimal installation of CentOS 6.6 :

 [acool@localhost ~]$ # 1.- install all these
 [acool@localhost ~]$ sudo yum groupinstall "Virtualization Platform" "Virtualization Tools"
 [acool@localhost ~]$ sudo yum install python-virtinst
 [acool@localhost ~]$ sudo yum install bridge-utils
 [acool@localhost ~]$
 [acool@localhost ~]$ # 1.a- dd image from CD-ROM
 [acool@localhost ~]$ sudo dd if=/dev/sr0 of=/usr/share/CentOS-6.6.iso
 [acool@localhost ~]$
 [acool@localhost ~]$ # 2.- start this
 [acool@localhost ~]$ sudo service libvirtd start
 [acool@localhost ~]$ sudo chkconfig libvirtd on
 [acool@localhost ~]$
 [acool@localhost ~]$ # 3.- modify eth0 and create network bridge file
 [acool@localhost ~]$ cat /etc/sysconfig/network-scripts/ifcfg-eth0
 DEVICE=eth0
 HWADDR=90:2B:34:10:25:C0
 TYPE=Ethernet
 UUID=c74e1b53-a135-4573-ac74-8fd00b06a7ea
 ONBOOT=yes
 NM_CONTROLLED=no
 BRIDGE=br0
 [acool@localhost ~]$
 [acool@localhost ~]$ cat /etc/sysconfig/network-scripts/ifcfg-br0
 DEVICE=br0
 TYPE=Bridge
 BOOTPROTO=static
 ONBOOT=yes
 IPADDR=192.168.1.45
 NETMASK=255.255.255.0
 GATEWAY=192.168.1.1
 DNS1=4.2.2.2
 DNS2=4.2.2.1
 DNS3=8.8.8.8
 [acool@localhost ~]$ # 4.- restart networking
 [acool@localhost ~]$ sudo service network restart
 [acool@localhost ~]$
 [acool@localhost ~]$ # 5.- put all these parameters in a file
 [acool@localhost ~]$ cat virt-install.sh
 sudo virt-install --connect qemu:///system \
 -n vm20 \
 -r 1024 \
 --vcpus=2 \
 --disk path=/var/lib/libvirt/images/vm20.img,size=12 \
 -c /usr/share/CentOS-6.6.iso \
 --graphics vnc \
 --noautoconsole \
 --os-type linux \
 --accelerate \
 --network=bridge:br0 \
 --hvm
 [acool@localhost ~]$
 [acool@localhost ~]$ # 6.- create VM !!
 [acool@localhost ~]$ ./virt-install.sh

 Starting install...
 Allocating 'vm20.img'                                            |  12 GB     00:00
 Creating domain...                                               |    0 B     00:00
 Domain installation still in progress. You can reconnect to
 the console to complete the installation process.
 [acool@localhost ~]$
 [acool@localhost ~]$ # 7.- make sure it's running
 [acool@localhost ~]$ sudo virsh list --all
  Id    Name                           State
 ----------------------------------------------------
  1     vm20                           running
  [acool@localhost ~]$
  [acool@localhost ~]$
  [acool@localhost ~]$ # In another computer, open Virtual Machine Manager and connect to 192.168.1.45 and install linux in vm20  :)
3

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.