| 133 | |
| 134 | == 步驟五: VMGL 使用說明: 在Dom0 上的設定 == |
| 135 | '''# 將 X-Windows 桌面 export 出來.''' [[BR]] |
| 136 | rider@cloud:~$ export DISPLAY=:0 [[BR]] |
| 137 | '''# 啟動 VLGL stub-daemon.''' [[BR]] |
| 138 | rider@cloud:~$ stub-daemon [[BR]] |
| 139 | '''# 檢查 stub-daemon 所對應的 port(7000) 有無開啟.''' [[BR]] |
| 140 | rider@cloud:~$ netstat -tunlp [[BR]] |
| 141 | |
| 142 | {{{ |
| 143 | Active Internet connections (only servers) |
| 144 | Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name |
| 145 | tcp 0 0 0.0.0.0:8002 0.0.0.0:* LISTEN - |
| 146 | tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN - |
| 147 | tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN - |
| 148 | tcp 0 0 0.0.0.0:7000 0.0.0.0:* LISTEN 29082/stub-daemon ---> VMGL stub-daemon |
| 149 | udp 0 0 0.0.0.0:32769 0.0.0.0:* - |
| 150 | udp 0 0 0.0.0.0:5353 0.0.0.0:* - |
| 151 | }}} |
| 152 | |
| 153 | == 步驟六: VMGL 使用說明: 在DomU 上的設定 == |
| 154 | # 設定 DomU 上的字型路徑對應. [[BR]] |
| 155 | rider@guest:~$ sudo ln -sf /usr/share/fonts/X11/ /usr/X11R6/lib/X11/fonts (if necessary - fix font path) [[BR]] |
| 156 | {{{ |
| 157 | # FontPath: |
| 158 | |
| 159 | /usr/X11R6/lib/X11/fonts |
| 160 | or |
| 161 | /usr/share/fonts/X11 |
| 162 | }}} |
| 163 | # 確認 rgb 存在於對應路徑. [[BR]] |
| 164 | rider@guest:~$ less /usr/X11R6/lib/X11/rgb.txt (if necessary - rgb path confirmation) [[BR]] |
| 165 | # 設定 DomU 上的 VMGL 環境變數. [[BR]] |
| 166 | rider@guest:~$ sudo vim /etc/profile [[BR]] |
| 167 | {{{ |
| 168 | GLSTUB=Cloud_IP(host_IP):7000 |
| 169 | LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib/vmgl |
| 170 | LD_PRELOAD=/usr/local/lib/vmgl/libGL.so |
| 171 | export GLSTUB LD_LIBRARY_PATH LD_PRELOAD |
| 172 | }}} |
| 173 | rider@guest:~$ source /etc/profile [[BR]] |
| 174 | # 設定 DomU 上的 X forwarding. [[BR]] |
| 175 | '''Using X forwarding''' [[BR]] |
| 176 | rider@guest:~$ sudo vim /etc/ssh/sshd_config [[BR]] |
| 177 | {{{ |
| 178 | X11Forwarding yes |
| 179 | }}} |
| 180 | rider@guest:~$ sudo vim /etc/ssh/ssh_config [[BR]] |
| 181 | {{{ |
| 182 | ForwardX11 yes |
| 183 | ForwardX11Trusted yes |
| 184 | }}} |
| 185 | # 重新啟動 DomU 上的 SSH Service. [[BR]] |
| 186 | rider@guest:~$ sudo /etc/init.d/ssh restart [[BR]] |
| 187 | # 設定 VNC server 使用者密碼. [[BR]]. [[BR]] |
| 188 | rider@guest:~$ /usr/bin/vncpasswd [[BR]] |
| 189 | # 開啟 DomU 上的第一台VNC Server. [[BR]] |
| 190 | rider@guest:~$ /usr/bin/vncserver -geometry 1024x768 -depth 24 :1 [[BR]] |
| 191 | # 開啟 DomU 上的第二台VNC Server.(可跳過此步驟) [[BR]] |
| 192 | rider@guest:~$ /usr/bin/vncserver -geometry 1024x768 -depth 24 :2 [[BR]] |
| 193 | # 檢查 VNCserver 有無開啟對應之 port(5901開始). [[BR]] |
| 194 | rider@guest:~$ netstat -tunlp [[BR]] |
| 195 | {{{ |
| 196 | (Not all processes could be identified, non-owned process info |
| 197 | will not be shown, you would have to be root to see it all.) |
| 198 | Active Internet connections (only servers) |
| 199 | Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name |
| 200 | tcp 0 0 0.0.0.0:5901 0.0.0.0:* LISTEN 10652/Xtightvnc ---> guest:1 |
| 201 | tcp 0 0 0.0.0.0:5902 0.0.0.0:* LISTEN 10630/Xtightvnc |
| 202 | tcp 0 0 0.0.0.0:6001 0.0.0.0:* LISTEN 10652/Xtightvnc ---> guest:2 |
| 203 | tcp 0 0 0.0.0.0:6002 0.0.0.0:* LISTEN 10630/Xtightvnc |
| 204 | tcp 0 0 127.0.0.1:6010 0.0.0.0:* LISTEN - |
| 205 | tcp6 0 0 :::22 :::* LISTEN - |
| 206 | tcp6 0 0 ::1:6010 :::* LISTEN - |
| 207 | }}} |
| 208 | |
| 209 | '''# 將 VNC Server:1 export 出來.''' [[BR]] |
| 210 | rider@guest:~$ export DISPLAY=:1 [[BR]] |
| 211 | |
| 212 | == 步驟七: 在 Dom0 上 透過 X forwarding 登入 DomU == |
| 213 | '''# 使用 X forwarding 的方式登入 DomU.''' [[BR]] |
| 214 | '''Using X forwarding''' [[BR]] |
| 215 | rider@cloud:~$ ssh -X guest [[BR]] |
| 216 | '''# 檢查 direct rendering 有無起來.''' [[BR]] |
| 217 | rider@guest:~$ glxinfo [[BR]] |
| 218 | {{{ |
| 219 | name of display: localhost:10.0 |
| 220 | display: localhost:10 screen: 0 |
| 221 | direct rendering: Yes |
| 222 | server glx vendor string: VMGL |
| 223 | server glx version string: 1.2 VMGL |
| 224 | server glx extensions: |
| 225 | client glx vendor string: VMGL |
| 226 | client glx version string: 1.2 VMGL |
| 227 | client glx extensions: |
| 228 | GLX version: 1.3 |
| 229 | GLX extensions: |
| 230 | OpenGL extensions: |
| 231 | GL_ARB_depth_texture, GL_ARB_fragment_program, GL_ARB_multisample, |
| 232 | GL_ARB_multitexture, GL_ARB_occlusion_query, GL_ARB_point_parameters, |
| 233 | GL_ARB_point_sprite, GL_ARB_shadow, GL_ARB_texture_border_clamp, |
| 234 | GL_ARB_texture_compression, GL_ARB_texture_cube_map, |
| 235 | GL_ARB_texture_env_add, GL_ARB_texture_env_combine, |
| 236 | GL_EXT_texture_env_combine, GL_ARB_texture_env_dot3, |
| 237 | GL_EXT_texture_env_dot3, GL_ARB_texture_mirrored_repeat, |
| 238 | GL_ARB_texture_non_power_of_two, GL_ARB_transpose_matrix, |
| 239 | GL_ARB_vertex_buffer_object, GL_ARB_vertex_program, GL_ARB_window_pos, |
| 240 | GL_EXT_blend_color, GL_EXT_blend_minmax, GL_EXT_blend_func_separate, |
| 241 | GL_EXT_blend_subtract, GL_EXT_texture_env_add, GL_EXT_fog_coord, |
| 242 | GL_EXT_multi_draw_arrays, GL_EXT_secondary_color, GL_EXT_shadow_funcs, |
| 243 | GL_EXT_stencil_wrap, GL_EXT_texture_cube_map, GL_EXT_texture_edge_clamp, |
| 244 | GL_EXT_texture_filter_anisotropic, GL_EXT_texture_lod_bias, |
| 245 | GL_EXT_texture_object, GL_EXT_texture3D, GL_EXT_bgra, |
| 246 | GL_IBM_rasterpos_clip, GL_NV_fog_distance, GL_NV_fragment_program, |
| 247 | GL_NV_register_combiners, GL_NV_register_combiners2, |
| 248 | GL_NV_texgen_reflection, GL_NV_texture_rectangle, GL_NV_vertex_program, |
| 249 | GL_NV_vertex_program1_1, GL_NV_vertex_program2, GL_SGIS_generate_mipmap, |
| 250 | GL_CR_state_parameter, GL_CR_cursor_position, GL_CR_bounding_box, |
| 251 | GL_CR_print_string, GL_CR_tilesort_info, GL_CR_synchronization, |
| 252 | GL_CR_head_spu_name, GL_CR_performance_info, GL_CR_window_size, |
| 253 | GL_CR_tile_info, GL_CR_saveframe, GL_CR_readback_barrier_size, |
| 254 | GL_CR_server_id_sharing, GL_CR_server_matrix |
| 255 | GLX_ARB_multisample |
| 256 | OpenGL vendor string: H. Andres Lagar-Cavilla |
| 257 | OpenGL renderer string: VMGL |
| 258 | OpenGL version string: 1.5 VMGL 1.9 |
| 259 | 0x52 24 dc 0 32 0 r y . 8 8 8 0 4 24 8 16 16 16 16 2 1 None |
| 260 | 0x53 24 dc 0 32 0 r y . 8 8 8 8 4 24 8 16 16 16 16 2 1 None |
| 261 | 0x54 24 dc 0 32 0 r y . 8 8 8 0 4 24 8 16 16 16 16 4 1 None |
| 262 | 0x55 24 dc 0 32 0 r y . 8 8 8 8 4 24 8 16 16 16 16 4 1 None |
| 263 | 0x56 24 dc 0 32 0 r . . 8 8 8 0 4 24 8 16 16 16 16 2 1 None |
| 264 | 0x57 24 dc 0 32 0 r . . 8 8 8 8 4 24 8 16 16 16 16 2 1 None |
| 265 | 0x58 24 dc 0 32 0 r . . 8 8 8 0 4 24 8 16 16 16 16 4 1 None |
| 266 | 0x59 24 dc 0 32 0 r . . 8 8 8 8 4 24 8 16 16 16 16 4 1 None |
| 267 | 0x23 32 tc 0 32 0 r y . 8 8 8 0 4 24 8 16 16 16 16 0 0 None |
| 268 | 0x5a 32 tc 0 32 0 r y . 8 8 8 8 4 24 8 16 16 16 16 0 0 None |
| 269 | 0x5b 32 tc 0 32 0 r . . 8 8 8 0 4 24 8 16 16 16 16 0 0 None |
| 270 | 0x5c 32 tc 0 32 0 r . . 8 8 8 8 4 24 8 16 16 16 16 0 0 None |
| 271 | 0x5d 32 tc 0 32 0 r y . 8 8 8 0 4 24 0 16 16 16 16 0 0 None |
| 272 | 0x5e 32 tc 0 32 0 r y . 8 8 8 8 4 24 0 16 16 16 16 0 0 None |
| 273 | 0x5f 32 tc 0 32 0 r . . 8 8 8 0 4 24 0 16 16 16 16 0 0 None |
| 274 | 0x60 32 tc 0 32 0 r . . 8 8 8 8 4 24 0 16 16 16 16 0 0 None |
| 275 | 0x61 32 tc 0 32 0 r y . 8 8 8 0 4 0 0 16 16 16 16 0 0 None |
| 276 | 0x62 32 tc 0 32 0 r y . 8 8 8 8 4 0 0 16 16 16 16 0 0 None |
| 277 | 0x63 32 tc 0 32 0 r . . 8 8 8 0 4 0 0 16 16 16 16 0 0 None |
| 278 | 0x64 32 tc 0 32 0 r . . 8 8 8 8 4 0 0 16 16 16 16 0 0 None |
| 279 | 0x65 32 tc 0 32 0 r y . 8 8 8 0 4 24 0 16 16 16 16 2 1 None |
| 280 | 0x66 32 tc 0 32 0 r y . 8 8 8 8 4 24 0 16 16 16 16 2 1 None |
| 281 | 0x67 32 tc 0 32 0 r y . 8 8 8 0 4 24 0 16 16 16 16 4 1 None |
| 282 | 0x68 32 tc 0 32 0 r y . 8 8 8 8 4 24 0 16 16 16 16 4 1 None |
| 283 | 0x69 32 tc 0 32 0 r . . 8 8 8 0 4 24 0 16 16 16 16 2 1 None |
| 284 | 0x6a 32 tc 0 32 0 r . . 8 8 8 8 4 24 0 16 16 16 16 2 1 None |
| 285 | 0x6b 32 tc 0 32 0 r . . 8 8 8 0 4 24 0 16 16 16 16 4 1 None |
| 286 | 0x6c 32 tc 0 32 0 r . . 8 8 8 8 4 24 0 16 16 16 16 4 1 None |
| 287 | 0x6d 32 tc 0 32 0 r y . 8 8 8 0 4 24 8 16 16 16 16 2 1 None |
| 288 | 0x6e 32 tc 0 32 0 r y . 8 8 8 8 4 24 8 16 16 16 16 2 1 None |
| 289 | 0x6f 32 tc 0 32 0 r y . 8 8 8 0 4 24 8 16 16 16 16 4 1 None |
| 290 | 0x70 32 tc 0 32 0 r y . 8 8 8 8 4 24 8 16 16 16 16 4 1 None |
| 291 | 0x71 32 tc 0 32 0 r . . 8 8 8 0 4 24 8 16 16 16 16 2 1 None |
| 292 | 0x72 32 tc 0 32 0 r . . 8 8 8 8 4 24 8 16 16 16 16 2 1 None |
| 293 | 0x73 32 tc 0 32 0 r . . 8 8 8 0 4 24 8 16 16 16 16 4 1 None |
| 294 | 0x74 32 tc 0 32 0 r . . 8 8 8 8 4 24 8 16 16 16 16 4 1 None |
| 295 | }}} |
| 296 | '''# DomU 上的 glxgears 效能測試.''' [[BR]] |
| 297 | rider@guest:~$ glxgears [[BR]] |
| 298 | {{{ |
| 299 | 47819 frames in 5.0 seconds = 9563.678 FPS |
| 300 | 46064 frames in 5.0 seconds = 9212.566 FPS |
| 301 | 44584 frames in 5.0 seconds = 8916.581 FPS |
| 302 | 44256 frames in 5.0 seconds = 8850.974 FPS |
| 303 | 44688 frames in 5.0 seconds = 8937.528 FPS |
| 304 | }}} |
| 305 | |
| 306 | == 步驟八: 使用 VNC Viewer 登入 DomU == |
| 307 | '''# 使用者可以用自己的 VNC Viewer(TurboVNC Viewer or Tightvnc viewer)登入 DomU 的 VNC Server,登入後就可以透過 rxvt 來下指令跑相關 3D 應用了.''' [[BR]] |
| 308 | @ 使用端電腦 |
| 309 | rider@PC:~$ vncviewer guest:1 [[BR]] |
| 310 | '''# 檢查 direct rendering=yes?.''' [[BR]] |
| 311 | @ VNC viewer 登入 :1 後 |
| 312 | rider@guest:~$ glxinfo [[BR]] |
| 313 | |
| 314 | == 實作四: 透過VMGL在虛擬機器上喀Game - 體驗 3D 效能 == |
| 315 | |
| 316 | == 步驟九: 喀 Game 時間 == |
| 317 | '''# 開啟 Firefox 來玩 Doom Online.''' [[BR]] |
| 318 | rider@guest:~$ firefox !http://necromanthus.com/Games/Flash/doom.html [[BR]] |