ubuntu上部署vnc

环境:
OS:18.04

说明:

安装盘没有vnc4server安装包,使用安装盘制作本地源找不到vnc的安装包,需要联网才行,下面是联网下的操作.

 

1.安装vnc4server
root@11g:/etc/apt#su - root
root@11g:/etc/apt#apt update
root@11g:/etc/apt#apt -y install vnc4server
查看是否安装成功
root@11g:/etc/apt#dpkg -l | grep vnc4server

 

2.安装 Xfce 桌面环境
查看是否安装,没有安装的话需要进行安装
root@11g:/etc/apt# dpkg -l | grep xfce4
root@11g:/etc/apt# dpkg -l | grep xfce4-goodies
root@11g:/etc/apt#apt install xfce4 xfce4-goodies

 

3.切换到oracle账号执行

复制代码
root@11g:/etc/apt# su - oracle
oracle@11g:~$ vncserver

You will require a password to access your desktops.

Password:
Verify:
xauth:  file /home/oracle/.Xauthority does not exist

New '11g:1 (oracle)' desktop is 11g:1

Creating default startup script /home/oracle/.vnc/xstartup
Starting applications specified in /home/oracle/.vnc/xstartup
Log file is /home/oracle/.vnc/11g:1.log
复制代码

 

这里密码我们设置为oracle

 

4.停止服务配环境
su - oracle
oracle@11g:~$ vncserver -kill :1
Killing Xvnc4 process ID 12532

5.备份一下原始文件
su - oracle
oracle@11g:~$ mv ~/.vnc/xstartup ~/.vnc/xstartup.bak

 

将下面内容放进去:
vim ~/.vnc/xstartup

#!/bin/bash
xrdb $HOME/.Xresources
startxfce4 &

 

文件中的第一条命令xrdb $HOME/.Xresources 告诉 VNC 的图形用户界面框架读取服务器用户的.Xresources文件。
用户可以在.Xresources文件中更改图形桌面的某些设置,如终端颜色、光标主题和字体渲染。
第二条命令是让服务器启动 Xfce。无论何时启动或重启 VNC 服务器,这些命令都会自动执行

 

6.添加一下权限
su - oracle
oracle@11g:~$chmod +x ~/.vnc/xstartup

 

7.重新启动

复制代码
su - oracle
oracle@11g:~$ vncserver

New '11g:1 (oracle)' desktop is 11g:1

Starting applications specified in /home/oracle/.vnc/xstartup
Log file is /home/oracle/.vnc/11g:1.log

查看端口
oracle@11g:~$ ss -nlp|grep 5901
tcp  LISTEN 0      5                                              *:5901                          *:*           users:(("Xvnc4",pid=12567,fd=3)) 
复制代码

 

8.使用vnc_viewer登录

 

 

 

9.复制粘贴问题

su - oracle 

vncconfig -nowin&  ##执行该命令vnc里的内容可以拷贝到本机

 

 

posted @   slnngk  阅读(34)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· DeepSeek 开源周回顾「GitHub 热点速览」
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· AI与.NET技术实操系列(二):开始使用ML.NET
· 单线程的Redis速度为什么快?
历史上的今天:
2022-07-02 rds下载备份集在ECS上恢复(解压目录与mysql data目录不同)
点击右上角即可分享
微信分享提示