LoginSignup
0
0

More than 5 years have passed since last update.

kvm vm deploy command memo

Last updated at Posted at 2019-02-20

kvm vm deploy command memo

objectives

  • personal memo

create disk image

VMNAME=''

qemu-img create -f qcow2 -o preallocation=metadata $VMNAME.qcow2 45G

deploy vm

RAM=''    ### 8192 = 8GB
CPU=''    ### 2 is multicpu
VNCPORT=''
ISOFILE=''
OSTYPE=''  ###[linux, unix, windows, other]

echo $VMNAME $RAM $CPU $VNCPORT $ISOFILE $OSTYPE
  • pattern 1
virt-install --connect qemu:///system \
-n $VMNAME \
-r $RAM \
--vcpus=$CPU \
--disk path=./$VMNAME.qcow2 \
-c ../osimages/$ISOFILE \
--os-type $OSTYPE \
--accelerate --network=bridge:br0,model=e1000 --hvm \
--graphics vnc,port=$VNCPORT,listen=0.0.0.0 \
-usbdevice tablet
    <input type='tablet' bus='usb'/>
  • pattern2
virt-install --connect qemu:///system \
-n $VMNAME \
-r $RAM \
--vcpus=sockets=1,cores=2,threads=2 \
--cpu Nehalem,match=exact,require=vmx \
--disk path=./$VMNAME.qcow2 \
-c ../osimages/$ISOFILE \
--os-type $OSTYPE \
--accelerate --network=bridge:br0,model=e1000 --hvm \
--graphics vnc,port=$VNCPORT,listen=0.0.0.0

access vnc with above port on kvm host

Screenshot from 2019-02-21 03-41-56.png

proceed OS installation

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0