Changes between Version 1 and Version 2 of Xen_Lab7
- Timestamp:
- Oct 7, 2009, 7:30:09 PM (16 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Xen_Lab7
v1 v2 6 6 ---- 7 7 = 【Step 1: 連線到遠端主機】 = 8 '''# 以下兩種連線方式擇一使用.''' [[BR]] 9 rider@cloud:~$ ssh 140.xxx.xxx.xxx [[BR]] 10 rider@cloud:~$ vncviewer 140.xxx.xxx.xxx [[BR]] 8 * 以下兩種連線方式擇一使用. 9 {{{ 10 $ ssh 140.xxx.xxx.xxx 11 $ vncviewer 140.xxx.xxx.xxx 12 }}} 11 13 ---- 12 14 = 【Step 2: 產生一台虛擬機器】 = 13 '''# 設定你想要怎樣規格的虛擬機器.''' [[BR]] 14 rider@cloud:~$ sudo vim /etc/xen-tools/xen-tools.conf [[BR]] 15 * 設定你想要怎樣規格的虛擬機器. 16 {{{ 17 $ sudo vim /etc/xen-tools/xen-tools.conf 18 }}} 15 19 {{{ 16 20 #!sh … … 34 38 reiser_options = defaults 35 39 }}} 36 rider@cloud:~$ sudo xen-create-image --hostname nvidia --ip 140.XXX.XXX.XXX [[BR]] 40 {{{ 41 $ sudo xen-create-image --hostname nvidia --ip xxx.xxx.xxx.xxx 42 }}} 37 43 ---- 38 44 = 【Step 3: 查看你的顯卡資訊】 = 39 rider@cloud:~$ lspci -vv 40 {{{ 45 {{{ 46 $ lspci -vv 47 }}} 48 {{{ 49 #!sh 41 50 01:00.0 VGA compatible controller: nVidia Corporation GeForce 9800 GT (rev a2) 42 51 Subsystem: ASUSTeK Computer Inc. Device 82a0 … … 56 65 ---- 57 66 = 【Step 4: PCI Frontend Configuration 設定你的 DomU 】 = 58 rider@cloud:~$ sudo vim /etc/xen/nvidia.cfg [[BR]] 67 {{{ 68 $ sudo vim /etc/xen/nvidia.cfg [[BR]] 69 }}} 59 70 {{{ 60 71 #!sh … … 89 100 ---- 90 101 = 【Step 5: PCI Backend Configuration 設定你的 Dom0 】 = 91 rider@cloud:~$ sudo su - [[BR]] 92 '''# Hide the device from dom0 so pciback can take control.''' [[BR]] 93 root@cloud:~$ echo -n "0000:01:00.0" > /sys/bus/pci/drivers/nvidia/unbind [[BR]] 94 95 '''# Give the dev_ids to pciback, and give it a new slot then bind.''' [[BR]] 96 root@cloud:~$ echo -n "0000:01:00.0" > /sys/bus/pci/drivers/pciback/new_slot [[BR]] 97 root@cloud:~$ echo -n "0000:01:00.0" > /sys/bus/pci/drivers/pciback/bind [[BR]] 98 99 root@cloud:~$ cat /sys/bus/pci/drivers/pciback/slots [[BR]] 100 {{{ 102 {{{ 103 $ sudo su - 104 }}} 105 * Hide the device from dom0 so pciback can take control. 106 {{{ 107 $ echo -n "0000:01:00.0" > /sys/bus/pci/drivers/nvidia/unbind 108 }}} 109 110 * Give the dev_ids to pciback, and give it a new slot then bind. 111 {{{ 112 $ echo -n "0000:01:00.0" > /sys/bus/pci/drivers/pciback/new_slot 113 $ echo -n "0000:01:00.0" > /sys/bus/pci/drivers/pciback/bind 114 }}} 115 {{{ 116 $ cat /sys/bus/pci/drivers/pciback/slots\ 117 }}} 118 {{{ 119 #!sh 101 120 0000:01:00.0 102 121 }}} 103 122 104 '''# Caution: Make sure that the device is not controlled by any driver: there should be no driver symlink for nvidia.''' [[BR]] 105 {{{ 123 * Caution: Make sure that the device is not controlled by any driver: there should be no driver symlink for nvidia. 124 {{{ 125 #!sh 106 126 PATH: /sys/bus/pci/devices/0000:01:00.0/ 107 127 driver -> ../../../../bus/pci/drivers/nvidia ---> This symlink shouldn't exist. … … 111 131 112 132 ==== Permissive Flag ==== 113 114 rider@cloud:~$ sudo vim /etc/xen/xend-pci-permissive.sxp [[BR]] 133 {{{ 134 $ sudo vim /etc/xen/xend-pci-permissive.sxp 135 }}} 115 136 {{{ 116 137 #!sh … … 122 143 123 144 ==== User-space Quirks ==== 124 125 rider@cloud:~$ sudo vim /etc/xen/xend-pci-quirks.sxp [[BR]] 145 {{{ 146 $ sudo vim /etc/xen/xend-pci-quirks.sxp [[BR]] 147 }}} 126 148 {{{ 127 149 #!sh … … 136 158 ---- 137 159 = 【Step 7: 啟動並登入你的虛擬機器 DomU 】 = 138 '''說明: 用 root 免密碼先登入,然後建立自己的帳號. 改用自己的帳號登入(亦可用 root 登入 , 不新建帳號 ):''' [[BR]] 139 @ Dom0 [[BR]] 140 rider@cloud:~$ sudo xm create -c nvidia.cfg [[BR]] 141 142 @ DomU [[BR]] 143 root@nvidia:~# adduser username [[BR]] 144 root@nvidia:~# vim /etc/sudoers [[BR]] 160 * 說明: 用 root 免密碼先登入,然後建立自己的帳號. 改用自己的帳號登入(亦可用 root 登入 , 不新建帳號 ) 161 * @ Dom0 162 {{{ 163 $ sudo xm create -c nvidia.cfg 164 }}} 165 166 * @ DomU 167 {{{ 168 $ sudo adduser username 169 $ sudo vim /etc/sudoers 170 }}} 145 171 {{{ 146 172 #!sh … … 149 175 ---- 150 176 = 【Step 8: 設定你的 DomU 基本環境】 = 151 '''# 設定 locales (系統語系)''' [[BR]] 152 rider@nvidia:~$ sudo vim /etc/profile [[BR]] 153 {{{ 177 * 設定 locales (系統語系) 178 {{{ 179 $ sudo vim /etc/profile 180 }}} 181 {{{ 182 #!sh 154 183 # Locale 155 184 export LANGUAGE="en_US.UTF-8" … … 157 186 export LANG="en_US.UTF-8" 158 187 }}} 159 rider@nvidia:~$ source /etc/profile [[BR]] 160 rider@nvidia:~$ sudo dpkg-reconfigure locales [[BR]] 161 '''# 更新 PCI ID Database''' [[BR]] 162 rider@nvidia:~$ sudo apt-get update [[BR]] 163 rider@nvidia:~$ sudo apt-get install wget [[BR]] 164 rider@nvidia:~$ sudo update-pciids [[BR]] 165 '''# 查看顯卡資訊有無正常顯示''' [[BR]] 166 rider@nvidia:~$ lspci [[BR]] 167 {{{ 188 {{{ 189 $ source /etc/profile 190 $ sudo dpkg-reconfigure locales 191 }}} 192 * 更新 PCI ID Database 193 {{{ 194 $ sudo apt-get update 195 $ sudo apt-get install wget 196 $ sudo update-pciids 197 }}} 198 * 查看顯卡資訊有無正常顯示. 199 {{{ 200 $ lspci 201 }}} 202 {{{ 203 #!sh 168 204 00:00.0 VGA compatible controller: nVidia Corporation GeForce 9800 GT (rev a2) 169 205 }}} 170 '''# 查看顯卡資源有無順利分配到 DomU''' [[BR]] 171 rider@nvidia:~$ dmesg | grep pci 172 {{{ 206 * 查看顯卡資源有無順利分配到 DomU. 207 {{{ 208 $ dmesg | grep pci 209 }}} 210 {{{ 211 #!sh 173 212 pcifront pci-0: Installing PCI frontend 174 213 pcifront pci-0: Creating PCI Frontend Bus 0000:00