2012年10月13日 星期六

gentoo

用livedvd安裝:

按Esc回到boot:
/boot/gentoo root=/dev/ram0 init=/linuxrc initrd=/boot/gentoo.igz dokeymap aufs looptype=squashfs loop=/images.squashfs cdroot nomodeset
在命令後面加上 nox
/boot/gentoo root=/dev/ram0 init=/linuxrc initrd=/boot/gentoo.igz cdroot nomodeset nox



開機後:
第一步開啟sshd1:設網絡
    ifconfig eth0 xxx.xxx.xxx.xxx
    route add default gw xxx.xxx.xxx.xxx
2:設密碼
    passwd root
3:啟動 sshd 服務:
   /etc/init.d/sshd start
4:連putty
   echo nameserver 8.8.8.8 > /etc/resolv.conf
   echo nameserver 8.8.4.4 > /etc/resolv.conf
第二步格式化硬碟
1:利用cfdisk分區
   cfdisk /dev/sda
sda1做boot, sda2做swap, sda3做主要磁區,
--------------------------------------------------------------------
Name    Flags    Part Type    FS Type
---------------------------------------------------------------------
sda1      Boot      Primary       Linux            250MB
sda2                    Primary       Linux            700MB
sda3                    Primary       Linux
---------------------------------------------------------------------
2:格式化分區:
    mkfs.ext3 /dev/sda1
    mkswap /dev/sda2
    mkfs.ext4 /dev/sda3
3:啟動swap交換分區:
   swapon /dev/sda2
4:把sda3,sda1掛上
mount /dev/sda3 /mnt/gentoo
mkdir /mnt/gentoo/boot
mount /dev/sda1 /mnt/gentoo/boot
5:開始複製LiveCD上的系統:
cp -apf  /mnt/static/* /mnt/gentoo/

cd /
cp -avx bin sbin lib lib32 lib64 boot usr opt emul etc root home var sys /mnt/gentoo/

mkdir /mnt/gentoo/proc /mnt/gentoo/dev
cd /mnt/gentoo/dev
mknod -m 660 console c 5 1
mknod -m 660 null c 1 3
mount -t proc none /mnt/gentoo/proc
mount -o bind /dev /mnt/gentoo/dev

6:查uuid
 blkid 
會看到

/dev/sda1: UUID="2df87859-21a2-4412-a33a-1881f0dd5ece" SEC_TYPE="ext2" TYPE="ext3"
/dev/sda2: UUID="8696720a-1c06-4940-b377-24167c5af002" TYPE="swap"
/dev/sda3: UUID="b92f275f-e0d0-4118-9ace-330c67e02f05" TYPE="ext4" 


改變uuid
tune2fs -U b92f275f-e0d0-4118-9ace-330c67e02f05 /dev/sda3


 7:把環境切換到硬盤
chroot /mnt/gentoo /bin/bash
env-update && source /etc/profile

8:修改硬盤 root 密碼
passwd root

9:從默認boot中移除啟動AutoConfig服務,否則您的root密碼是每次啟動時復位。
rc-update del autoconfig default

12:寫入下面的分區信息:
nano -w /etc/fstab
#/dev/sda1
UUID=41c22818-fbad-4da6-8196-c816df0b7aa8 /boot ext3 noauto,noatime 1 2
#/dev/sda2
UUID="8696720a-1c06-4940-b377-24167c5af002" none swap sw 0 0
#/dev/sda3
UUID="b92f275f-e0d0-4118-9ace-330c67e02f05" / ext4 defaults 0 1
/dev/cdrom /mnt/cdrom iso9660 noauto,ro 0 0
proc /proc proc defaults 0 0
shm /dev/shm tmpfs nodev,nosuid,noexec,size=128m 0 0


11:複製 kernel 到 /boot區
cp /usr/src/linux/System.map /boot/System.map
cp /usr/src/linux/arch/x86/boot/bzImage /boot/vmlinuz
genkernel ramdisk
 ln -s initramfs-genkernel-x86-3.3.0-gentoo initrd.img

11改開機選單nano -w  /boot/grub/grub.conf
//----------------------------------------
default 0
timeout 30
splashimahe=(hd0,0)/boot/grub/splash.xpm.gz
title neo-Gentoo-Linux
root (hd0,0)
search –no-floppy –fs-uuid –set b92f275f-e0d0-4118-9ace-330c67e02f05  #用sd3的uuid
kernel /boot/vmlinuz root=/dev/rm0 real_root=UUID=b92f275f-e0d0-4118-9ace-330c67e02f05 ramdisk_size=8192 vga=791 noxinitrd /boot/initrd.img
//----------------------------------------

10:安裝 grub 到 mbr
grub
root (hd0,0)
setup (hd0)
quit

13:設定時區,hostname
cp /usr/share/zoneinfo/Asia/Taipei /etc/localtime
nano -w /etc/conf.d/hostnameHOSTNAME="GentooVM"

14:網路設定
nano -w /etc/conf.d/net
//----------------------------------
# DHCP config_eth0=( "dhcp" )  
# 使用CIDR形式表示的靜態IP 
config_eth0=( "192.168.0.7/24" ) 
routes_eth0=( "default via 192.168.0.1" ) 
# 使用netmask形式表示的靜態IP 
config_eth0=( "192.168.0.7 netmask 255.255.255.0" ) 
routes_eth0=( "default via 192.168.0.1" )
//---------------------------------- 
建立符號連接net.eth0指向net.lo 
# cd /etc/init.d 
# ln -s net.lo net.eth0
啟動和停止網絡腳本
# /etc/init.d/net.eth0 start
# /etc/init.d/net.eth0 stop
配置網絡接口以便在啟動的時候裝載它
# rc-update add net.eth0 default
 
15:加入sshd服務
rc-status確認有沒有開sshd
rc-update add sshd default

16:退出環境,重開機,退出光碟
exit
reboot

--------------------------------------------------------------------------------------------------------------------------------

minimal CD安裝:
 
可先檢查系統效能評估安裝時間 
# grep bogo /proc/cpuinfo
bogomips       : 3337.81
# hdparm -tT /dev/sda
/dev/sda:
 Timing cached reads:   1100 MB in  2.00 seconds = 549.97 MB/sec
 Timing buffered disk reads:  224 MB in  3.01 seconds =  74.36 MB/sec
# grep MemTotal /proc/meminfo
MemTotal:       509248 kB

開機後
boot: gentoo-nofb
 
檢查安裝模組
livecd root # lspci 
若有需要安裝的模組  
modprobe r8169
 
確認網卡模組
/usr/sbin/lspci | grep -i ethernet
底下是VM模組 Host bridge: Intel Corporation 440FX - 82441FX PMC [Natoma] (rev 02)
ISA bridge: Intel Corporation 82371SB PIIX3 ISA [Natoma/Triton II]
IDE interface: Intel Corporation 82371SB PIIX3 IDE [Natoma/Triton II]
USB controller: Intel Corporation 82371SB PIIX3 USB [Natoma/Triton II] (rev 01)
VGA compatible controller: Cirrus Logic GD 5446
Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8139/8139C/8139C+ (rev 20)
Multimedia audio controller: Intel Corporation 82801AA AC'97 Audio Controller (rev 01)
RAM memory: Red Hat, Inc Virtio memory balloon


 
 
第一步設定網路
撥接部份
pppoe-setup
pppoe-start
VPN部份
nano -w /etc/ppp/chap-secrets 
nano -w /etc/ppp/options.pptp 
# pptp <server ip> 
區網部份
net-setup eth0
 ifconfig eth0 xxx.xxx.xxx.xxx
 route add default gw xxx.xxx.xxx.xxx
 echo nameserver 8.8.8.8 > /etc/resolv.conf
 開啟sshd
passwd root
/etc/init.d/sshd start

第二步格式化硬碟
1:利用cfdisk分區
   cfdisk /dev/sda
sda1做boot, sda2做swap, sda3做主要磁區,
--------------------------------------------------------------------
Name    Flags    Part Type    FS Type
---------------------------------------------------------------------
sda1      Boot      Primary       Linux            250MB
sda2                    Primary       Linux            700MB
sda3                    Primary       Linux
---------------------------------------------------------------------
2:格式化分區:
    mkfs.ext3 /dev/sda1
    mkswap /dev/sda2
    mkfs.ext3 /dev/sda3
3:啟動swap交換分區:
   swapon /dev/sda2
4:把sda3,sda1掛上
mount /dev/sda3 /mnt/gentoo
mkdir /mnt/gentoo/boot
mount /dev/sda1 /mnt/gentoo/boot

連上gentoo網站下載stage3

# links http://www.gentoo.org/main/en/mirrors.xml
cd /mnt/gentoo
wget ftp://gentoo.cs.nctu.edu.tw/gentoo/releases/x86/current-stage3/stage3-i686-*.tar.bz2
time tar xjpf stage3*
(解出bin dev etc home lib media mnt opt proc root run sbin sys tmp usr var)
cd /mnt/gentoo/usr
wget ftp://gentoo.cs.nctu.edu.tw/gentoo/snapshots/portage-latest.tar.bz2
time tar xjf portage-lat*
 (解出/mnt/gentoo/usr/portage)

掛上proc,dev跟切換磁碟
cd / 
mount -t proc proc /mnt/gentoo/proc
mount --rbind /dev /mnt/gentoo/dev
cp -L /etc/resolv.conf /mnt/gentoo/etc/
chroot /mnt/gentoo /bin/bash
env-update && source /etc/profile
 
設定hostname 
livecd / # cd /etc
livecd etc # echo "127.0.0.1 neo.at.neoplace neo localhost" > hosts
livecd etc # sed -i -e 's/hostname.*/hostname="neo"/' conf.d/hostname
(Use defined host name and check)
livecd etc # hostname neo
livecd etc # hostname -f
neo.at.neoplace
 

編譯內核安裝:
nano -w /etc/make.globals
GENTOO_MIRRORS="http://distfiles.gentoo.org/"改成 ftp://ftp.isu.edu.tw/pub/Linux/Gentoo/

for EPC
CFLAGS = "-0s -march=pentium-m -pipe -fno-ident -fomit-frame-pointer"  
其他
CFLAGS="-O2 -march=i686 -pipe"
# Use the same settings for both variables
CXXFLAGS="${CFLAGS}"
 

emerge --sync
emerge -av app-misc/screen
screen

emerge axel
nano -w /etc/make.globals
最後加上 
FETCHCOMMAND='/usr/bin/axel -a -S4 -o "\${DISTDIR}/\${FILE}" "\${URI}"'
RESUMECOMMAND="${FETCHCOMMAND}"

time emerge gentoo-sources 
(在/usr/src/linux裝source) 
cd /usr/src/linux
make menuconfig
time make -j2
make modules_install
cp /usr/src/linux/arch/x86/boot/bzImage /boot/kernel
cp arch/i386/boot/bzImage /boot/kernel 
建立initramfs檔   
emerge genkernel
genkernel --install --no-ramdisk-modules initramfs    

寫入下面的分區信息:
nano -w /etc/fstab
/dev/sda1 /boot ext3 noauto,noatime 1 2
/dev/sda2 none swap sw 0 0
/dev/sda3 / ext3 noatime 0 1
/dev/cdrom /mnt/cdrom iso9660 noauto,ro 0 0
proc /proc proc defaults 0 0
shm /dev/shm tmpfs nodev,nosuid,noexec,size=128m 0 0


安裝grub
time emerge grub
nano -w /boot/grub/grub.conf
//------------------------------------- 
default 0
timeout 10
splashimahe=(hd0,0)/boot/grub/splash.xpm.gz
 
title Gentoo
root (hd0,0) 
kernel /boot/kernel root=/dev/rm0 real_root=/dev/sda3 ramdisk_size=8192 vga=791 nox 
initrd /boot/initramfs
//-----------------------------------------------------
grub
grub> root (hd0,0)
grub> setup (hd0)
grub> quit
 
passwd
 
cd /etc/init.d
ln -s net.lo net.eth0
cd ../conf.d
echo 'config_eth0="xxx.xxx.xxx.xxx netmask 255.255.255.0"' >> net
echo 'routes_eth0="default via xxx.xxx.xxx.xxx"' >> net     
echo 'hostname="myhostname"' > hostname
rc-update add net.eth0 default
rc-update add sshd default
 
 
 
echo 'modules="r8139cp"' >> /etc/conf.d/modules
 
 
reboot     

2012年10月11日 星期四

linux 雙核問題

邏輯CPU個數

cat /proc/cpuinfo | grep "processor" | wc -l

cat /proc/interrupts

           CPU0       CPU1      
  0:        168          0   IO-APIC-edge      timer
  1:         79          0   IO-APIC-edge      i8042
  4:          2          0   IO-APIC-edge   
  8:          1          0   IO-APIC-edge      rtc0
  9:          0          0   IO-APIC-fasteoi   acpi
 10:     302080          0   IO-APIC-fasteoi   virtio0, eth0
 11:        314          0   IO-APIC-fasteoi   uhci_hcd:usb1, sym53c8xx, Intel 82801AA-ICH
 12:        667          0   IO-APIC-edge      i8042
 14:      35182          0   IO-APIC-edge      ata_piix
 15:       3225          0   IO-APIC-edge      ata_piix
NMI:          0          0   Non-maskable interrupts
LOC:    2361875    2546808   Local timer interrupts
SPU:          0          0   Spurious interrupts
PMI:          0          0   Performance monitoring interrupts
IWI:          0          0   IRQ work interrupts
RES:      23414      23637   Rescheduling interrupts
CAL:         48      21032   Function call interrupts
TLB:       2334       1823   TLB shootdowns
TRM:          0          0   Thermal event interrupts
THR:          0          0   Threshold APIC interrupts
MCE:          0          0   Machine check exceptions
MCP:          0          0   Machine check polls


可以看到

10: 302080 .................eth0

利用

cat /proc/irq/irq編號/smp_affinity

cat /proc/irq/10/smp_affinity

秀3表示用CPU0和CPU1 (2^0+2^1)

Binary       Hex
CPU 0    0001         1
CPU 1    0010         2
CPU 2    0100         4
CPU 3    1000         8

利用

echo 3 > /proc/irq/10/smp_affinity 
有些網卡在開機啟動時要加上pci=nomsi的參數

也可裝上irqbalance
#yum install irqbalance

chkconfig--level 345 irqbalance on    //開機啟動。
serviceirqbalance start 

 

CentOS 6

安裝xfce:
sudo rpm -ivh http://download.Fedoraproject.org/pub/epel/6/x86_64/epel-release-6-5.noarch.rpm  

yum search xfce  
yum groupinfo xfce
yum groupinstall xfce
//-----------------------------------
安裝freenx

yum install freenx
/usr/bin/nxsetup --install
 
vi /etc/nxserver/node.conf 
ENABLE_PASSDB_AUTHENTICATION="1" 

加入登入帳號 
sudo nxserver --adduser neo
sudo nxserver --passwd neo

sudo /usr/lib/nx/nxsetup --install --setup-nomachine-key 
sudo nxserver --restart   

查看nxserver狀態 
sudo nxserver --status
 
刪除原有session
ps -ef|grep nxagent
看到/usr/bin/nxagent -persistent -D -name NX - 使用者@hostname...的ID_number 
sudo kill nxagent的ID_number 
 
windows nx client部份:
把/var/lib/nxserver/home/.ssh/client.id_dsa.key下載到windows
在General->Server->Key...
匯入dsa_key 
import client.id_dsa.key 
 
General->Desktop->Settings->Application->Run the following command
打上/usr/bin/startxfce4 
General->Desktop->Settings->Options
選New Virtual Desktop 

2012年10月10日 星期三

lubuntu 12.04

//-----------------------------
更新source.list
sudo sed -i 's/tw.archive.ubuntu.com/ubuntu.stu.edu.tw/g' /etc/apt/sources.list
sudo apt-get update
sudo apt-get upgrade
//-----------------------------
#deb cdrom:[Ubuntu 12.04 LTS _Precise Pangolin_ - Release amd64 (20120425)]/ dists/precis
e/main/binary-i386/
#deb cdrom:[Ubuntu 12.04 LTS _Precise Pangolin_ - Release amd64 (20120425)]/ dists/precis
e/restricted/binary-i386/
#deb cdrom:[Ubuntu 12.04 LTS _Precise Pangolin_ - Release amd64 (20120425)]/ precise main
 restricted
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://ubuntu.stu.edu.tw/ubuntu/ precise main restricted
deb-src http://ubuntu.stu.edu.tw/ubuntu/ precise main restricted
## Major bug fix updates produced after the final release of the
## distribution.
deb http://ubuntu.stu.edu.tw/ubuntu/ precise-updates main restricted
deb-src http://ubuntu.stu.edu.tw/ubuntu/ precise-updates main restricted
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb http://ubuntu.stu.edu.tw/ubuntu/ precise universe
deb-src http://ubuntu.stu.edu.tw/ubuntu/ precise universe
deb http://ubuntu.stu.edu.tw/ubuntu/ precise-updates universe
deb-src http://ubuntu.stu.edu.tw/ubuntu/ precise-updates universe
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://ubuntu.stu.edu.tw/ubuntu/ precise multiverse
deb-src http://ubuntu.stu.edu.tw/ubuntu/ precise multiverse
deb http://ubuntu.stu.edu.tw/ubuntu/ precise-updates multiverse
deb-src http://ubuntu.stu.edu.tw/ubuntu/ precise-updates multiverse
## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
deb http://ubuntu.stu.edu.tw/ubuntu/ precise-backports main restricted universe multivers
e
deb-src http://ubuntu.stu.edu.tw/ubuntu/ precise-backports main restricted universe multi
verse
deb http://security.ubuntu.com/ubuntu precise-security main restricted
deb-src http://security.ubuntu.com/ubuntu precise-security main restricted
deb http://security.ubuntu.com/ubuntu precise-security universe
deb-src http://security.ubuntu.com/ubuntu precise-security universe
deb http://security.ubuntu.com/ubuntu precise-security multiverse
deb-src http://security.ubuntu.com/ubuntu precise-security multiverse
## Uncomment the following two lines to add software from Canonical's
## 'partner' repository.
## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
# deb http://archive.canonical.com/ubuntu precise partner
# deb-src http://archive.canonical.com/ubuntu precise partner
## This software is not part of Ubuntu, but is offered by third-party
## developers who want to ship their latest software.
deb http://extras.ubuntu.com/ubuntu precise main
deb-src http://extras.ubuntu.com/ubuntu precise main
//----------------------------------------------------------------------------------------------------------------------------
安裝freeNX
wget https://bugs.launchpad.net/freenx-server/+bug/576359/+attachment/1378450/+files/nxsetup.tar.gz 
sudo add-apt-repository ppa:freenx-team
sudo apt-get update && sudo apt-get install freenx
tar -xvf nxsetup.tar.gz
sudo cp nxsetup /usr/lib/nx/nxsetup
sudo /usr/lib/nx/nxsetup --install --clean --purge --setup-nomachine-key 
sudo /usr/lib/nx/nxsetup --install
sudo /etc/init.d/freenx-server restart
 
sudo vi /etc/nxserver/node.conf
加入以下幾行
SERVER_NAME="$(hostname)"
SSHD_PORT=22
ENABLE_PASSDB_AUTHENTICATION="1"
 
sudo /usr/lib/nx/nxloadconfig 
sudo nxserver --restart  
 
加入登入帳號 
sudo nxserver --adduser neo
sudo nxserver --passwd neo
 
查看nxserver狀態 
sudo nxserver --status
 
刪除原有session
ps -ef|grep nxagent
看到/usr/bin/nxagent -persistent -D -name NX - 使用者@hostname...的ID_number 
sudo kill nxagent的ID_number 
 
/var/lib/nxserver/home/.ssh/authorized_keys2 
 
windows nx client部份:
刪除
把/var/lib/nxserver/home/.ssh/client.id_dsa.key下載到windows
在General->Server->Key...
匯入dsa_key 
import client.id_dsa.key
 
General->Desktop->Settings->Application->Run the following command
打上startlubuntu或/usr/bin/lxsession -s Lubuntu -e LXDE
General->Desktop->Settings->Options
選New Virtual Desktop 
//-----------------------------------------------------------------------------     使用xming+ssh
startlubuntu
 或
/usr/bin/lxsession -s Lubuntu -e LXDE
//-----------------------------------------------
關閉防火牆
sudo ufw disable

2012年10月9日 星期二

KVM

Check CPU:

Intel CPU:
grep vmx /proc/cpuinfo
AMD CPU:
grep svm /proc/cpuinfo

INSTALL:
  • libvirt-bin:提供 libvirtd,用來管理 qemu 與 kvm。
  • vvm或qemu-kvm:主要的虛擬引擎。
  • ubuntu-vm-builder:強大的虛擬機器製作工具。
  • bridge-utils:用來建立虛擬機器使用的 bridge。


sudo apt-get install kvm libvirt-bin ubuntu-vm-builder bridge-utils

sudo apt-get install virt-manager 

sudo apt-get install virt-viewer 

在安裝完成後,系統會自動將您的 username 加入 libvirtd 群組,在這個群組中的使用者才能夠使用 KVM
重新登入後,首先檢查安裝是否正確,執行:
virsh -c qemu:///system list

檢查 sock 檔的權限:
sudo ls -la /var/run/libvirt/libvirt-sock
應該要像這樣
srwxrwx--- 1 root libvirtd 0 2012-02-04 13:38 /var/run/libvirt/libvirt-sock

修改網卡設定:

sudo vm /etc/network/interfaces

# The loopback network interface
auto lo
iface lo inet loopback

iface eth0 inet manual

auto br0

iface br0 inet static
address 原來eth0的IP
netmask 255.255.255.0
gateway 原來eth0的gateway
# 橋接到eth0
bridge_ports eth0
bridge_stp on
dns-nameservers 8.8.8.8
//--------------------------------------------------
若是用NAT方式:
virsh net-list
輸出為

Name State Autostart
-----------------------------------------
default active yes
virsh net-dumpxml default > default.xml

內容應該像這樣:
<network>
<name>default</name>
<uuid>45f1405b-791a-06e4-d8e8-8bcfffc4c90f</uuid>
<forward mode='nat'/>
<bridge name='virbr0' stp='on' delay='0' />
<ip address='192.168.100.1' netmask='255.255.255.0'>
<dhcp>
<range start='192.168.100.2' end='192.168.100.254' />
</dhcp>
</ip>
</network>

 改完傳回virsh
 virsh define default.xml
接著將這個 default 設定設為自動啓動,並啟動這個 default 設定:
virsh net-autostart default
virsh net-start default

 //--------------------------------------------------------
列出關於dom0的相關資訊:
virsh nodeinfo   
列出domain0上的virtual machines:
 virsh list --all
查看特定virtual machine的資訊:
 virsh dominfo <VM ID>

//----------------------------------------------------------------------------------
建立磁碟映像檔
qemu-img create -f raw -o /home/neo/demo.raw 8G
建立VM
virt-install \
              --connect qemu:///system \
              --name demo \
              --ram 1024 \
              --disk path=/home/neo/demo.raw,size=5 \
              --network bridge=br0 \
              --accelerate \
              --vnc \
              --cdrom /home/neo/Downloads/win7.iso

 //---------------------------------------------------------------------------------

啟動virsh -c qemu:///system start myvm
關機
virsh -c qemu:///system shutdown myvm
virsh -c qemu:///system destroy myvm
重開  
virsh -c qemu:///system reboot myvm


virt-viewer連線
本機:
virt-viewer -c qemu:///system myvm

遠端:
virt-viewer -c qemu+ssh://server/system myvm


重新 define,操作步驟為:
virsh dumpxml guest1 > guest1.xml
virsh undefine guest1
virsh define guest1.xml
virsh start guest1


可用qemu-system-x86_64試試
qemu-system-x86_64 -m 512 -boot d -drive file=/home/neo/demo.raw,cache=writeback,if=virtio,boot=on -fda /home/neo/Downloads/virtio-win-1.1.16.vfd -cdrom /home/neo/Downloads/win7.iso
 

修正 VNC 連線滑鼠游標失準問題
virsh shutdown guest1-win7
virsh edit guest1-win7

#在 <devices>...</devices> 之間任一處加入:
<input type='tablet' bus='usb'/>
virsh start guest1-win7

用 Gigabit 網卡 (驅動程式在 virtio-win-0.1-15.iso)
virsh shutdown guest1-win7
virsh edit guest1-win7

#找到 <interface type='bridge'>, 在 </interface> 之前加入:
<model type='virtio'/>
virsh start guest1-win7