图形界面必备 X Window System
yum -y groupinstall "X Window System"
安装epel源
yum -y install epel-release
安装VNC+图形需要的软件
yum -y install tigervnc-server openbox xfce4-terminal tint2 cjkuni-ukai-fonts network-manager-applet
自动修改/etc/xdg/openbox/autostart配置文件
echo 'if which dbus-launch >/dev/null && test -z "$DBUS_SESSION_BUS_ADDRESS"; then' > /etc/xdg/openbox/autostart
echo ' eval dbus-launch --sh-syntax --exit-with-session
' >> /etc/xdg/openbox/autostart
echo 'fi' >> /etc/xdg/openbox/autostart
echo 'tint2 &' >> /etc/xdg/openbox/autostart
echo 'nm-applet &' >> /etc/xdg/openbox/autostart
echo 'xfce4-terminal &' >> /etc/xdg/openbox/autostart
echo ' ' >> /etc/xdg/openbox/autostart
防火墙放行VNC端口
firewall-cmd --add-port=5901/tcp
firewall-cmd --add-port=5901/tcp --permanent
创建database用户组
groupadd database
创建oracle用户并放入database组中
useradd oracle -g database
设置oracle密码
passwd oracle
su oracle
首次运行,生成~/.vnc/xstartup等配置文件
vncserver :1 -geometry 1024x768
配置VNC默认启动openbox
echo "openbox-session &" > ~/.vnc/xstartup
停止服务
vncserver -kill :1
重新开启vnc服务
vncserver :1 -geometry 1024x768
然后输入上面设置的连接密码就可以了。我这里设置的密码是 vnc@2021
如果你连接的时候发现,没有界面,是黑屏的只有一个鼠标,那么可以重启一下VNC服务试试。
切换到oracle用户su oracle
命令:
vncserver -kill :1
vncserver :1 -geometry 1024x768
这里还有黑屏用户,我发现这就是问题所在。
[En]
There are also black screen users here, and I found that this is the problem.
改变xstartup的权限
这个问题很容易被很多人忽视,也是连接成功后出现黑屏的原因之一。
[En]
This problem is easy for many people to ignore, and it is also one of the reasons for the black screen after a successful connection.
在CentOS中,xstartup的文件路径为:/root/.vnc/ (可以通过locate xstartup来查看xstartup的文件路径)
所以需要执行:chmod 777 /root/.vnc/xstartup
摘自:http://asusai.com/index.php/archives/11/
打开宝塔接口对应的端口,安全组:5901
[En]
Open the corresponding port in the pagoda interface and security group: 5901
在https://www.realvnc.com/en/connect/download/viewer/下载Vnc Viewer
连接后,下载软件到目录
wine **.exe则跑通流程
此处注意是否为64位程序, wine64 **.exe
Original: https://www.cnblogs.com/cxykhaos/p/15367014.html
Author: 程序员khaos
Title: 宝塔配置vnc+wine实现Q群机器人
原创文章受到原创版权保护。转载请注明出处:https://www.johngo689.com/524479/
转载文章受原作者版权保护。转载请注明原作者出处!