樹心幽徑

« 20180525在ubuntu1604裝GTK2.0 examples | Main | 20180530解決acer電腦win10休眠後無法開機問題 »

20180526在ubuntu1604裝KVM
2018/05/26,13:35

REF:http://blog.sina.com.cn/s/blog_820478da0100zvo6.html

(1)treehrt@treehrt-fire:~$ egrep '^flags.*(vmx|svm)' /proc/cpuinfo

(2)

treehrt@treehrt-fire:~$ sudo apt-get install kvm qemu

Processing triggers for ureadahead (0.100.0-19) ...

treehrt@treehrt-fire:~$ qemu-img create hda.img 10G
Formatting 'hda.img', fmt=raw size=10737418240
treehrt@treehrt-fire:~$

treehrt@treehrt-fire:~$ ls -l|grep hda
-rw-r--r--  1 treehrt treehrt 10737418240  5月 26 13:47 hda.img
treehrt@treehrt-fire:~$ pwd
/home/treehrt
treehrt@treehrt-fire:~$

(3)

treehrt@treehrt-fire:~$ sudo adduser treehrt kvm
正將 `treehrt' 使用者新增至 `kvm' 群組 ...
正在將使用者“treehrt”加入到“kvm”群組中
完成。
treehrt@treehrt-fire:~$

(4)

treehrt@treehrt-fire:~$ sudo adduser treehrt disk
正將 `treehrt' 使用者新增至 `disk' 群組 ...
正在將使用者“treehrt”加入到“disk”群組中
完成。
treehrt@treehrt-fire:~$

(5)

treehrt@treehrt-fire:~$ sudo apt-get install bridge-utils

(6)

@treehrt-fire:~$ sudo invoke-rc.d networking stop
treehrt@treehrt-fire:~$ sudo vim /etc/network/interfaces
treehrt@treehrt-fire:~$ cat /etc/network/interfaces
# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet manual

auto br0
iface br0 inet dhcp
bridge_ports eth0
bridge_stp off
bridge_fd 0
bridge_maxwait 0

 

(7)

treehrt@treehrt-fire:~$ sudo invoke-rc.d networking restart
treehrt@treehrt-fire:~$ ifconfig
br0       Link encap:Ethernet  HWaddr 6e:ba:b7:88:87:91 
          inet6 addr: fe80::6cba:b7ff:fe88:8791/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:36 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:6779 (6.7 KB)

enp0s31f6 Link encap:Ethernet  HWaddr b0:6e:bf:60:9d:23 
          inet addr:192.168.1.103  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::4224:7ec4:579f:744e/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:41984 errors:0 dropped:0 overruns:0 frame:0
          TX packets:25431 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:56149346 (56.1 MB)  TX bytes:2322221 (2.3 MB)
          Interrupt:16 Memory:df100000-df120000

lo        Link encap:Local Loopback 
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:1380 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1380 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:127858 (127.8 KB)  TX bytes:127858 (127.8 KB)

treehrt@treehrt-fire:~$

 

迴響

 
Accessible and Valid XHTML 1.0 Strict and CSS Powered by LifeType