文章目录
  1. 1. 安装环境和前期条件
  2. 2. 安装步骤
    1. 2.1. 配置Yum源
    2. 2.2. 代理服务器配置
      1. 2.2.1. 设置wget的代理
      2. 2.2.2. 设置Yum的代理
    3. 2.3. 预先安装可能导致出错的包
    4. 2.4. 开始安装 vda
    5. 2.5. 安装 VirtualBox

虽然说Oracle已经停止了VDI的开发,之后支持服务业很快停止了。但是,作为经典的桌面虚拟化产品,还是值得研究一番。虽然Oracle VDI的文档已经写的很详细了,但是在实际操作过程中,还是会遇到很多问题。最近,终于鼓起勇气,在VDI即将消失之前,把安装过程记录一下。

安装环境和前期条件

  • OS: Oralce Linux 6 update5 x86-64
  • Oracle VDI 3.5.2
  • SELinux 已经禁用
  • 防火墙(iptables)已经关闭

安装步骤

配置Yum源

首先需要保证能上外网,并能够访问public-yum.oracle.com

开始配置Yum环境,把public-yum-ol6.repo下载到/etc/yum.repos.d目录,并编辑内容如下:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
[ol6_u5_base]
name=Oracle Linux $releasever Update 5 installation media copy ($basearch)
baseurl=http://public-yum.oracle.com/repo/OracleLinux/OL6/5/base/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=1 ###开启
[ol6_addons]
name=Oracle Linux $releasever Add ons ($basearch)
baseurl=http://public-yum.oracle.com/repo/OracleLinux/OL6/addons/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=1 ###开启
[ol6_UEK_base]
name=Unbreakable Enterprise Kernel for Oracle Linux $releasever ($basearch)
baseurl=http://public-yum.oracle.com/repo/OracleLinux/OL6/UEK/base/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=1 ###开启
[ol6_gdm_multiseat]
name=Oracle Linux 6 GDM Multiseat ($basearch)
baseurl=http://public-yum.oracle.com/repo/OracleLinux/OL6/gdm_multiseat/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=1 ###开启

配置/etc/yum.conf,在文件末尾加入如下内容:

1
2
# 开启多版本库支持
protected_multilib=0

代理服务器配置

如果使用代理服务器上外网的话,还需要做如下设置。

设置wget的代理

/etc/wgetrc修改为如下内容:

1
2
3
4
5
# You can set the default proxies for Wget to use for http, https, and ftp.
# They will override the value in the environment.
https_proxy = http://my-proxy.example.com:80/
http_proxy = http://my-proxy.example.com:80/
ftp_proxy = http://my-proxy.example.com:80/

设置Yum的代理

/etc/yum.conf末尾加入如下内容:

1
proxy=http://my-proxy.example.com:80/

预先安装可能导致出错的包

sssd-client可能在安装过程中出现错误,先手动安装一下。

1
[root@vdi ~]# yum install sssd-client

在64为系统中会安装libXfont.x86_64,但是VDI需要32位的版本 - libXfont.i686,这也可能出现问题,先手动安装一下。

1
[root@vdi]# yum install -y libXfont.i686

安装过程中会需要安装pam.i686,在64位环境下,已经安装了pam.x86-64。同时安装32位和64位的包可能会产生如下错误:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
Transaction Check Error:
file /etc/security/limits.conf from install of pam-1.1.1-20.el6.i686 conflicts with file from package pam-1.1.1-17.el6.x86_64
file /usr/share/doc/pam-1.1.1/Linux-PAM_SAG.txt from install of pam-1.1.1-20.el6.i686 conflicts with file from package pam-1.1.1-17.el6.x86_64
file /usr/share/doc/pam-1.1.1/html/sag-pam_cracklib.html from install of pam-1.1.1-20.el6.i686 conflicts with file from package pam-1.1.1-17.el6.x86_64
file /usr/share/doc/pam-1.1.1/html/sag-pam_limits.html from install of pam-1.1.1-20.el6.i686 conflicts with file from package pam-1.1.1-17.el6.x86_64
file /usr/share/doc/pam-1.1.1/html/sag-pam_userdb.html from install of pam-1.1.1-20.el6.i686 conflicts with file from package pam-1.1.1-17.el6.x86_64
file /usr/share/doc/pam-1.1.1/txts/README.pam_cracklib from install of pam-1.1.1-20.el6.i686 conflicts with file from package pam-1.1.1-17.el6.x86_64
file /usr/share/doc/pam-1.1.1/txts/README.pam_userdb from install of pam-1.1.1-20.el6.i686 conflicts with file from package pam-1.1.1-17.el6.x86_64
file /usr/share/man/man5/limits.conf.5.gz from install of pam-1.1.1-20.el6.i686 conflicts with file from package pam-1.1.1-17.el6.x86_64
file /usr/share/man/man5/namespace.conf.5.gz from install of pam-1.1.1-20.el6.i686 conflicts with file from package pam-1.1.1-17.el6.x86_64
file /usr/share/man/man8/faillock.8.gz from install of pam-1.1.1-20.el6.i686 conflicts with file from package pam-1.1.1-17.el6.x86_64
file /usr/share/man/man8/pam_cracklib.8.gz from install of pam-1.1.1-20.el6.i686 conflicts with file from package pam-1.1.1-17.el6.x86_64
file /usr/share/man/man8/pam_env.8.gz from install of pam-1.1.1-20.el6.i686 conflicts with file from package pam-1.1.1-17.el6.x86_64
file /usr/share/man/man8/pam_faillock.8.gz from install of pam-1.1.1-20.el6.i686 conflicts with file from package pam-1.1.1-17.el6.x86_64
file /usr/share/man/man8/pam_lastlog.8.gz from install of pam-1.1.1-20.el6.i686 conflicts with file from package pam-1.1.1-17.el6.x86_64
file /usr/share/man/man8/pam_tty_audit.8.gz from install of pam-1.1.1-20.el6.i686 conflicts with file from package pam-1.1.1-17.el6.x86_64
file /usr/share/man/man8/pam_userdb.8.gz from install of pam-1.1.1-20.el6.i686 conflicts with file from package pam-1.1.1-17.el6.x86_64

这个pam包中的一个既存的bug,通过下面的方法解决:

1
2
3
4
5
[root@vdi ~]# yum install -y yum-downloadonly
[root@vdi ~]# yum install pam.i686 -y --downloadonly --downloaddir=/tmp
[root@vdi ~]# cd /tmp
[root@vdi tmp]# rpm -ivh --force --nodeps pam-1.1.1-20.el6.i686.rpm
[root@vdi tmp]# yum reinstall pam.i686

题外话,使用yum安装软件,老是会遇到这种提示:

1
2
3
Existing lock /var/run/yum.pid: another copy is running as pid 3053.
Another app is currently holding the yum lock; waiting for it to exit...
The other application is: PackageKit

只要把/etc/yum/pluginconf.d/refresh-packagekit.conf改为如下就OK了:

1
enabled=0

开始安装 vda

由于VDI安装脚本调用了curl来检查联网状态,所以如果是通过代理服务器上外网的,还需要在执行安装命令之前为curl设置如下环境变量以使用代理:

1
2
3
4
[root@vdi vda_3.5.2_linux]# export http_proxy=http://my-proxy.example.com:80/
[root@vdi vda_3.5.2_linux]# export https_proxy=$http_proxy
[root@vdi vda_3.5.2_linux]# export HTTP_PROXY=$http_proxy
[root@vdi vda_3.5.2_linux]# export HTTPS_PROXY=$http_proxy

现在可以开始安装了,安装过程中Yum会自动连外网下载依赖的包,过程会很漫长:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
[root@vdi vda_3.5.2_linux]# unzip p21441793_350_Linux-x86-64.zip
[root@vdi vda_3.5.2_linux]# cd vda_3.5.2_linux
[root@vdi vda_3.5.2_linux]# ./vda-install
Oracle Virtual Desktop Infrastructure 3.5.2 Installation
Checking for required libraries and packages...
30 packages are missing and will be installed by the software manager yum:
iscsi-initiator-utils.x86_64, nss.x86_64, nss.i686, libgcc.x86_64, libgcc.i686, libstdc++.x86_64, libstdc++.i686, gtk2.x86_64, gtk2.i686, compat-openldap, compat-openldap.i686, dhcp, gdbm.i686, gdm-multiseat, ksh, libusb.i686, libXcursor.i686, libXfixes.i686, libXfont.i686, libXinerama.i686, libXp.i686, libXpm.i686, libXtst.i686, libXv.i686, openldap-clients, openmotif.i686, sssd-client.i686, tftp, tftp-server, tk
Do you want to continue? ([y]/n) y
+ Installing missing packages...
Oracle VDI 3.5.2 Installation
+ Installing Oracle VDI Installation Utilities...
+ Installing Java DMK 5.1 Libraries...
+ Installing Common Agent Container - Runtime...
+ Installing Oracle VDI Core...
+ Installing Oracle VDI Center Agent...
+ Installing MySQL Database...
+ Installing Oracle VDI Web server...
+ Installing Oracle VDI Manager...
+ Installing RDP Broker...
+ Installing Java Runtime Environment...
+ Installing Sun Ray Server Software...
+ Installing Sun Ray Client Software...
Oracle VDI 3.5.2 was successfully installed.
A log file is available at '/var/log/vda-install.2015_08_18_12:14:18.log'.
You can continue to configure Oracle VDI 3.5.2 with '/opt/SUNWvda/sbin/vda-config'.
Do you want to configure Oracle VDI 3.5.2 now? ([y]/n) y
Oracle Virtual Desktop Infrastructure 3.5.2 Configuration
An Oracle VDI Center consists of one or several Oracle VDI Hosts. You can create a new Oracle VDI Center by configuring this server as the Primary Oracle VDI Host.
High availability requires a second Oracle VDI Host in the center. You can add as many Secondary Oracle VDI Hosts to an existing Oracle VDI Center as needed. During configuration, you will be asked to enter user name and password of a privileged account on the Primary Oracle VDI Host.
Please note that joining an Oracle VDI Center causes a short interruption of active sessions on the Primary Oracle VDI Host.
1 New Oracle VDI Center
2 Join Oracle VDI Center
Select (1/2): 1
Review the settings for a new Oracle VDI Center:
Name: VDI Center
Administrator Password: ********
VDI Administrator (super-user): root
DNS name of this host: vdi.example.com
Maximum number of sessions on this host: 100
User ID range start: 150000
Database: Embedded Oracle VDI
Do you want to create the Oracle VDI Center now? Enter 'c' to customize the settings. ([y]/c): y
System Configuration
+ Creating new instance of Common Agent Container (vda)...
+ Common Agent Container (vda) is reachable at vdi.example.com:11174
+ Setting properties for Common Agent Container (vda)...
+ Enabling Common Agent Container (vda) at system boot...
Oracle VDI Center Agent Configuration
+ Stopping Common Agent Container (vda)...
+ Deploying center agent module in Common Agent Container (vda)...
+ Restarting Common Agent Container (vda)...
+ Creating Oracle VDI Center...
+ Configuring time synchronization...
Sun Ray Server Software Configuration
+ Configuring Sun Ray Server Software...
Sun Ray Client Configuration
+ Setting Kiosk Mode Session Type to 'Oracle Virtual Desktop Infrastructure'...
+ Setting Sun Ray Policy ...
+ Enabling LAN Connections...
+ Restarting Sun Ray Server Software...
MySQL Database Server Configuration
+ Generating Secure Socket Layer certificates...
+ Creating MySQL group (vdadb)...
+ Creating MySQL user (vdadb)...
+ Setting up MySQL directory...
+ Initializing database...
+ Registering database service...
+ Starting Oracle VDI database (MySQL)...
+ Configuring MySQL Root Password...
+ Creating database user with Administrator privileges...
+ Creating database users for replication...
+ Configuring MySQL Information...
MySQL Database Client Configuration
+ Setting user rights...
+ Creating database tables...
+ Configuring database connection...
+ Importing Secure Socket Layer certificates...
+ Updating Common Agent Container properties...
Oracle VDI Service Configuration
+ Deploying service module in Common Agent Container (vda)...
+ Configuring primary administrator root
Oracle VDI Manager Configuration
+ Registering Oracle VDI Manager...
+ Restarting Oracle VDI Manager...
RDP Broker Configuration
+ Registering RDP broker...
+ Starting RDP broker...
The configuration of Oracle VDI 3.5.2 has completed.
WARNING: The current DBus file descriptor limit can only support up to approximately 120 logged-in desktops. It is recommended to reboot the system if you require support for more desktops.
This server is configured as a Primary Oracle VDI Host of the new Oracle VDI Center 'VDI Center'.
A log file is available at '/var/log/vda-config.2015_08_18_12:28:08.log'.
The command line tools are located at '/opt/SUNWvda/sbin'.
You can access the Oracle VDI Manager at http://vdi.example.com:1800
[root@vdi vda_3.5.2_linux]#

安装 VirtualBox

接下来,需要安装 VirtualBox。需要连外网通过wget来下载VirtualBox的安装文件。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
[root@vdi vda_3.5.2_linux]# unzip vbox_4.2.zip
Archive: vbox_4.2.zip
creating: vbox_4.2/
inflating: vbox_4.2/SLA.txt
inflating: vbox_4.2/vda-solaris.conf
inflating: vbox_4.2/vb-install
inflating: vbox_4.2/httpd.conf
inflating: vbox_4.2/config.conf
inflating: vbox_4.2/vda-linux.conf
inflating: vbox_4.2/ReadMe.txt
inflating: vbox_4.2/Oracle_VM_VirtualBox_Extension_Pack-4.2.30-100415-ENTERPRISE.vbox-extpack
inflating: vbox_4.2/autoresponse
[root@vdi vda_3.5.2_linux]# cd vbox_4.2
[root@vdi vbox_4.2]# ./vb-install
Oracle VM VirtualBox 4.2.30 Installation for Linux
Verifying dependencies
VirtualBox 4.2.30 for Linux hosts Download
+ Downloading ''...
Select an existing user for VirtualBox [root]: root
Enter the password for user 'root':
Specify the VirtualBox SSL port [443]:
Oracle VM VirtualBox 4.2 Installation
+ Installing Oracle VM VirtualBox Core
+ Installing Oracle VM VirtualBox Extension Pack
SSH Configuration
+ Enabling root access
+ Restarting SSH Service
Oracle VM VirtualBox Webservice Configuration
+ Creating SSL certificates
+ Configuring Webservice
+ Enabling Webservice
Oracle VM VirtualBox was successfully installed.
A log file is available at '/var/log/vb-install.2015_08_18_12:34:05.log'.
You can access the Oracle VM VirtualBox host at vdi.example.com, port 443.
[root@vdi vbox_4.2]#

至此,Oracle VDI的安装已经完成,接下来就可以登录到 Oracle VDI Manager开始配置了:

http://vdi.example.com:1800

由于接下来的配置工作都是基于图形界面完成的,这里就不再赘述,可以参考这篇文档来进行。

(END)

文章目录
  1. 1. 安装环境和前期条件
  2. 2. 安装步骤
    1. 2.1. 配置Yum源
    2. 2.2. 代理服务器配置
      1. 2.2.1. 设置wget的代理
      2. 2.2.2. 设置Yum的代理
    3. 2.3. 预先安装可能导致出错的包
    4. 2.4. 开始安装 vda
    5. 2.5. 安装 VirtualBox