KVM的各種坑

2021-07-03 04:31:19 字數 2732 閱讀 8435

1. 編譯的坑

費了老大勁,找到這幫人的郵件往來,才知道這裡面有乙個命令寫錯來,一行一行的修改之後,才得以通過編譯

記錄如下:

diff --git a/qemu-options.hx b/qemu-options.hx

index 4bc9c85..3af60bf 100644

--- a/qemu-options.hx

+++ b/qemu-options.hx

@@ -2095,18 +2095,13 @@ qemu supports using either local sheepdog devices or remote networked

devices.

syntax for specifying a sheepdog device

-@table @list

-``sheepdog:''

--``sheepdog::''

--``sheepdog::''

--``sheepdog:::''

--``sheepdog::::''

--``sheepdog::::''

+@table @code

+@item sheepdog:+@item sheepdog::+@item sheepdog::+@item sheepdog:::+@item sheepdog::::+@item sheepdog::::@end table

2. 在安裝完成之後要搭建橋接,媽的,好多文章都是瞎寫,亂吵,這裡給出終極解決辦法

首先,安裝必要的程式包,然後從命令列建立linux網橋。

$ sudo apt-get install bridge-utils 

$ sudo brctl addbr br0 

下一步是,在/etc/network/inte***ces中配置linux網橋,那樣一旦主機啟動,該網橋就會自動配置。想使用/etc/network/inte***ces,你就要禁用系統上的network manager(網路管理器),如果你在使用它的話。按這裡給出的指示(操作,以禁用網路管理器。

禁用了網路管理器後,接下來在/etc/network/inte***ces中配置linux網橋br0,如下所示。

#auto eth0 

#iface eth0 inet dhcp 

auto br0 

iface br0 inet dhcp 

bridge_ports eth0 

bridge_stp off 

bridge_fd 0 

bridge_maxwait 0 

這裡我假設,eth0是主要的網路介面,可以訪問外部網路。另外,我還假設,eth0通過dhcp獲得其ip位址。請注意:/etc/network/inte***ce中沒有etho的配置。etho網橋受制於br0時,linux網橋br0接過eth0的配置。

重啟網路服務,證實linux網橋已成功配置。如果配置成功,br0應該被賦予eth0的dhcp ip位址,eth0應該沒有被賦予任何ip位址。

$ sudo /etc/init.d/networking restart 

$ ifconfig 

3. 建立kvm虛擬機器的時候報錯

現在先說說解決gedit warning問題:

我在使用gedit開啟檔案的時候,會提示一堆的警告:

(gedit:9778): gtk-warning **: attempting to store changes into `/root/.local/share/recently-used.xbel', but failed: failed to create file '/root/.local/share/recently-used.xbel.ltbp3v': no such file or directory

(gedit:9778): gtk-warning **: attempting to set the permissions of `/root/.local/share/recently-used.xbel', but failed: no such file or directory

(gedit:9778): gtk-warning **: attempting to set the permissions of `/root/.local/share/recently-used.xbel', but failed: no such file or directory

(gedit:9778): gtk-warning **: attempting to store changes into `/root/.local/share/recently-used.xbel', but failed: failed to create file '/root/.local/share/recently-used.xbel.mn6r3v': no such file or directory

(gedit:9778): gtk-warning **: attempting to set the permissions of `/root/.local/share/recently-used.xbel', but failed: no such file or directory

根據上面的提示,以及網上查的資料,知道的怎麼解決:

直接在終端中輸入:sudo mkdir -p /root/.local/share/

即可..呵呵,解決了問題之一。

還有坑,後面我再慢慢加

KVM各種知識彙總

1,kvm 磁碟空間擴充套件 qemu img resize dev vg00 vm moni 2g 2,kvm宿主機多塊網絡卡,如何實現多網絡卡冗餘和負載均衡?bond0不要設定位址,ifcfg bond0 內容可以這樣 device bond0 onboot yes bootproto none...

各種api 的坑

最近在做新的專案,設計打檔案傳輸問題,lua和c 互動。踩了不少坑,也收穫很多。1.lual tointeger 和lua tonumber 在把大檔案的大小傳給c 時,用 lua tointeger取出,導致計算出錯。後來經過仔細看了lua api文件,才發現,這個介面轉出的結果是整形,長度明顯不...

for in 的各種坑

for in方法用來遍歷陣列或者物件的顯性屬性,就是說我們自己定義的屬性都是可以遍歷的,而物件固有的屬性,比如object.prototype.tostring是遍歷不出來的。for in方法簡潔好用,但依舊有一些需要注意的地方 1.遍歷順序 var b for var key in b for v...