메뉴 건너뛰기

2019.07.11 21:42

libvirt qemu

조회 수 0 추천 수 0 댓글 0
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄

virt-install \
--virt-type=kvm \
--name Win7-Original \
--ram 4096 \
--vcpus=4 \
--os-variant=win7 \
--cdrom=/volume/iso/en_windows_thin_pc_x86_697681.iso \
--cdrom=/volume/iso/virtio-win-0.1.141.iso \
--disk path=/volume/vmfs/Win7-Original/Windows7.OS.qcow2,size=64,bus=virtio,format=qcow2 \
--disk path=/volume/vmfs/Win7-Original/Windows7.Storage.qcow2,size=400,bus=virtio,format=qcow2 \
--network=bridge=virbr0,model=virtio \
--graphics vnc,password='n45w21f4',listen='0.0.0.0',port='5901' --noautoconsole \
--sound default


List Running Virtual Machines
virsh list

List All Virtual Machines
virsh list --all


Managing Guest State

Shutdown Guest
virsh shutdown $VM_ID_OR_NAME

Start Guest
virsh start $VM_ID_OR_NAME

Reboot Guest
virsh reboot $VM_ID_OR_NAME

Destroy a Guest
virsh destroy $VM_ID_OR_NAME

Delete a Guest
virsh undefine $VM_ID_OR_NAME


Guest Configuration
sudo virsh edit $VM_ID

List OS Variants
osinfo-query os

Rename guest
virsh domrename $OLD_NAME $NEW_NAME

Guest Start on Boot (Autostart)
sudo virsh autostart $VM_ID


To disable Guest Autostart
sudo virsh autostart --disable $VM_ID

Resizing Memory
sudo virsh edit $VM_ID

CPU Management
sudo virsh schedinfo $VM_ID

Permanently Set CPU Shares For Live Running Instance
sudo virsh schedinfo $VM_ID \
--set cpu_shares=[0-262144] \
--live \
--current \
--config

Get the CPU Pinning Settings for a Guest
virsh vcpupin blog.programster.org
VCPU: CPU Affinity
----------------------------------
   0: 0-3
   1: 0-3

Pin A CPU
virsh vcpupin blog.programster.org 0 2


Suspend Guest
virsh suspend $VM_ID_OR_NAME
Resume Guest
virsh resume $VM_ID_OR_NAME


Start Network Config
sudo virsh net-start $NETWORK_ID

Enable Network Autostart
net-autostart --network $NETWORK_ID

Disable Network Autostart
net-autostart \
--network $NETWORK_ID \
--disable

Guest Console
Enter Guest's Console
sudo virsh console $VM_ID

Exit Guest's Console
Cntrl-]

Saving
Save Guest
virsh save $VM_ID $FILENAME

Load Guest
virsh restore $FILENAME

Simple Guest Clone
virt-clone \
--original $VM_TO_CLONE \
--auto-clone \
--name $NEW_VM_NAME

Networking
List Running Network Configs
virsh net-list

List All Network Configs
virsh net-list --all

Edit Network Config
sudo virsh net-list $NE+F2TWORK_NAME

Create Temporary Network Config
sudo virsh net-create --file $ABSOLUTE_FILE_PATH

Create Permanent Network Config
sudo virsh net-define --file $ABSOLUTE_FILE_PATH

Example Bridge Network Config File
<network>
  <name>examplebridge</name>
  <forward mode='route'/>
  <bridge name='kvmbr0' stp='on' delay='0'/>
  <ip address='192.168.1.1' netmask='255.255.255.0' />
+F5</network>




List of Articles
번호 제목 글쓴이 날짜 조회 수
19 Virtual machine CPU configuration 맨하탄노숙자 2019.07.12 0
18 CentOS 7 KVM Bridge Network 브릿지 설정 맨하탄노숙자 2019.07.11 0
» libvirt qemu 맨하탄노숙자 2019.07.11 0
16 Booting from a cdrom in a kvm guest using libvirt 맨하탄노숙자 2019.07.11 0
15 virt-install OS variant does not exist 맨하탄노숙자 2019.07.07 0
14 KVM Cheatsheet - centos 맨하탄노숙자 2019.07.07 0
13 Easily upgrade ESXi 5.x to the latest ESXi 6.0 via CLI 맨하탄노숙자 2016.04.30 170
12 VMware ESXi vib 설치 맨하탄노숙자 2016.04.30 185
11 Enabling the SSD option on SSD based disks/LUNs that are not detected as SSD by default (2013188) 맨하탄노숙자 2016.04.05 205
10 Installing on VMware vib 맨하탄노숙자 2016.04.05 151
9 esxi 6 vib install 맨하탄노숙자 2016.04.05 153
8 esxi force reboot - esxi 6 강제 재부팅 맨하탄노숙자 2016.04.02 184
7 CloudStack 4.1 설치하기 맨하탄노숙자 2015.06.19 188
6 RemoteFX - Windows 7 가상 머신에서 DirectX 9c 환경을 제공 맨하탄노숙자 2015.05.14 610
5 MS RemoteFX 관련 VM별 메모리 할당 크기 file 맨하탄노숙자 2015.05.14 191
4 VMware에서 Port forwarding 방법 맨하탄노숙자 2015.04.27 211
3 Using VMware Workstation VMware Workstation 11 Manual file 맨하탄노숙자 2015.04.19 249
2 VMware workstation 11 host Linux NAT 셋업 맨하탄노숙자 2015.04.17 395
1 VMware Workstation 11.x Universal License for Windows & Linux secret 맨하탄노숙자 2015.04.16 0
Board Pagination Prev 1 Next
/ 1