Changes between Version 1 and Version 2 of Xen_Lab7


Ignore:
Timestamp:
Oct 7, 2009, 7:30:09 PM (15 years ago)
Author:
rider
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Xen_Lab7

    v1 v2  
    66----
    77= 【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}}}
    1113----
    1214= 【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}}}
    1519{{{
    1620#!sh
     
    3438reiser_options = defaults
    3539}}}
    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}}}
    3743----
    3844= 【Step 3: 查看你的顯卡資訊】 =
    39 rider@cloud:~$ lspci -vv
    40 {{{
     45{{{
     46$ lspci -vv
     47}}}
     48{{{
     49#!sh
    415001:00.0 VGA compatible controller: nVidia Corporation GeForce 9800 GT (rev a2)
    4251        Subsystem: ASUSTeK Computer Inc. Device 82a0
     
    5665----
    5766= 【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}}}
    5970{{{
    6071#!sh
     
    89100----
    90101= 【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
    1011200000:01:00.0
    102121}}}
    103122
    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
    106126PATH: /sys/bus/pci/devices/0000:01:00.0/
    107127driver -> ../../../../bus/pci/drivers/nvidia ---> This symlink shouldn't exist.
     
    111131
    112132==== 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}}}
    115136{{{
    116137#!sh
     
    122143
    123144==== 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}}}
    126148{{{
    127149#!sh
     
    136158----
    137159= 【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}}}
    145171{{{
    146172#!sh
     
    149175----
    150176= 【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
    154183# Locale
    155184export LANGUAGE="en_US.UTF-8"
     
    157186export LANG="en_US.UTF-8"
    158187}}}
    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
    16820400:00.0 VGA compatible controller: nVidia Corporation GeForce 9800 GT (rev a2)
    169205}}}
    170 '''# 查看顯卡資源有無順利分配到 DomU''' [[BR]]
    171 rider@nvidia:~$ dmesg | grep pci
    172 {{{
     206 * 查看顯卡資源有無順利分配到 DomU.
     207{{{
     208$ dmesg | grep pci
     209}}}
     210{{{
     211#!sh
    173212pcifront pci-0: Installing PCI frontend
    174213pcifront pci-0: Creating PCI Frontend Bus 0000:00