#virsh version
#tree /etc/libvirt
#tree /var/log/libvirt
1.下載映像檔
#wget http://www.vyatta.com/downloads/vc6.5/vyatta-livecd_VC6.5R1_i386.iso
2.產生虛擬硬碟檔
#kvm-img create -f qcow2 vyatta.qcow2 1G
3.開始安裝
#virt-install -r 512 -n vyatta --disk path=./vyatta.qcow2, format=qcow2 --noreboot --cdrom vyatta-livecd_VC6.5R1_i386.iso vyatta.qcow2 -boot d
4.啟動
#kvm -m 1024 -cdrom vyatta-livecd_VC6.5R1_i386.iso vyatta.qcow2
(登入帳密 vyatta vyatta)
#virsh list --all
(確認狀態)
QEMU裡
#install system
(連續按Enter)
#show version
#virsh shutdown vyatta
#tree libvirt
#virsh undefine vyatta
(把定義檔xml移除)
linux作業系統 -=>縮寫 --=>全名
--------------------------------------------------------------------------------------------------
#apt-get install libvirt-bin
安裝目錄為
1./etc/libvirt (root)
2./var/libvirt/ (root)
#apt-get install virtinst virt-viewer
#kvm-img create -f qcow2 vyatta.qcow2
#virt-install -r 512 -n vyatta --disk path=~/vyatta.qcow, format=qcow2 --noreboot --cdrom ~/vyatta.iso
#virsh list --all
#virsh start vyatta
#virsh shutdown vyatta
-----------------------------------------------
#xmllint -- noout abc.xml
(檢查xml檔案內容)
<?xml version="1.0"?>
<bobe>
<disk>
<name>vyatta06.qcow2</name>
<type>qcow</type>
<size>1G</size>
</disk>
</bobe>
#xpath -e "/bobe/disk/name/textc()" conf/mydisk.xml 2>/dev/null
2>/dev/nul=>黑洞裝置
#x=$(xpath -e "/bobe/disk/name/textc()" conf/mydisk.xml 2/dev/null)
#y=$(xpath -e "/bobe/disk/type/textc()" conf/mydisk.xml 2/dev/null)
#z= $(xpath -e "/bobe/disk/size/textc()" conf/mydisk.xml 2/dev/null)
#kvm-img create -f $y $x $z
($y=>取出變數y的內容)
#nano mkdisk.sh
#!/bin/bash
x=$(xpath -e "/bobe/disk/name/textc()" conf/mydisk.xml 2/dev/null)
y=$(xpath -e "/bobe/disk/type/textc()" conf/mydisk.xml 2/dev/null)
z=$(xpath -e "/bobe/disk/size/textc()" conf/mydisk.xml 2/dev/null)
[ -f $x ] && exit 1
kvm-img create -f $y$x$z &>/dev/null
[ "$? != 0 ] && echo "error $?"
exit 0
&&=>前面條件成立,後面接著做
exit 1=>離開
&>/dev/null=>不管隊的錯的訊息都丟黑洞
"$?=>前一個命令的結果
#echo $?
(上一個命令執行的結果,非0的數字代表執行不正常)
訂閱:
張貼留言 (Atom)
-
[Office] 自從您上次存檔後檔案 (filename.xls) 可能已由另一位使用者變更 當您嘗試將 Microsoft Excel 活頁簿儲存到網路伺服器時,如果該伺服器正在執行例如 Services for Macintosh 的中繼服務,或是在開啟活頁簿時出現...
-
Use AMISCE tool to update BIOS configuration under linux Test fucntion without change dump file 1.Copy SCELNX_64 to Linux_Flash folder 2...
-
I would like to thank you for all your support during the past years and hope that you will continue to extend the same to my replacement, ...
沒有留言:
張貼留言