linux on android vnc,Configuring VNC Server on Linux

linux安装oracle时,需用图形化界面安装。所以可采取下列的工具辅助安装

sysvint (Original Method)

The sysvinit method works for RHEL and it‘s clones (Oracle Linux and CentOS) up to and including RHEL6. It also works for Fedora up to and including Fedora 15. Although Fedora 15 includes systemd, the VNC server configuration is unchanged, so you should still use this method.

Install the VNC Server.

# yum install tigervnc-server

Edit the "/etc/sysconfig/vncservers" file to configure the required displays. The following entries enable VNC for display numbers ":2" and ":3". Notice multiple "display:user" pairs are defined on a single line, but the arguments for each display are defined separately.

VNCSERVERS="1:root"

VNCSERVERARGS[2]="-geometry 1280x1024 -nolisten tcp -localhost"

此处以上方为例

#VNCSERVERS="2:root 3:oracle"

#VNCSERVERARGS[2]="-geometry 1280x1024 -nolisten tcp -localhost"

#VNCSERVERARGS[3]="-geometry 1280x1024"

Set the VNC password for any users defined in the "/etc/sysconfig/vncservers" file.

密码必须设置**

# vncpasswd

Password:

Verify:

#

#################

# su - oracle

$ vncpasswd

Password:

Verify:

$ exit

logout

#

Enable the "vncserver" service for autostart and start the service.

# chkconfig vncserver on

# service vncserver start

You should now be able to use a VNC viewer to connect to system using the display numbers and passwords defined.

Use the following commands to stop the service and disable autostart.

# service vncserver stop

# chkconfig vncserver off

使用VNC viewer就可以远程连接服务器,输入IP:1。

systemd (New Method)

The systemd method works for Fedora 16 and above. Although Fedora 15 uses systemd, the VNC server configuration is unchanged so you still use the previous configuration method. This method also works for RHEL7/OL6/CentOS7.

Install the VNC Server.

# yum install tigervnc-server

Create a new configuration file for each of the display numbers you want to enable. In the following case, I am setting up the display number ":3". Notice how the display number is included in the configuration file name. In some Fedora releases they suggest not including the display number, as systemd will spawn correct config in memory on first request.

# cp /lib/systemd/system/[email protected] /lib/systemd/system/[email protected]:3.service

Edit the new configuration file, amending the user and startup arguments as necessary. An example of the changed lines is shown below. All other lines should be unmodified. The geometry is set below, but this line doesn‘t have to be modified if the default geometry of "1280x1024" is acceptable.

User=oracle

ExecStart=/usr/bin/vncserver %i -geometry 1440x1080

PIDFile=/home/oracle/.vnc/%H%i.pid

Run the following command.

# systemctl daemon-reload

Set the VNC password for the user defined in the new configuration file.

# su - oracle

$ vncpasswd

Password:

Verify:

Would you like to enter a view-only password (y/n)? n

$ exit

logout

#

Enable the service for autostart and start the service.

# systemctl enable [email protected]:3.service

# systemctl start [email protected]:3.service

You should now be able to use a VNC viewer to connect to system using the display number and password defined.

Use the following commands to stop the service and disable autostart.

# systemctl stop [email protected]:3.service

# systemctl disable [email protected]:3.service

VNC Clients

Once your VNC server is configured, you can connect to it from any VNC server. On Linux this will often be TigerVNC, installed using the following command.

# yum install tigervnc

Connect to a VNC server using the following command.

# vncviewer machine-name:port

# vncviewer maggie.localdomain:3

# vncviewer 192.168.0.4:3

首先是手机端。 (下面文件:androidvncserver和源码地址已经优化更改,省去必须用SVN获得源码) 1)下载androidvncserver: http://dl.dbank.com/c044xm5255 有兴趣的可以下载源码自己重新编译,源码地址: (源码需要在linux下mk) http://dl.dbank.com/c0xxpne414 2)把androidvncserver复制到手机上,我是复制到/data/local/文件夹下。复制的方法很多: 可以用adb push进去,即: 1.adb push ./androidvncserver /data/local/ 也可以复制到SD卡,再用Root Explorer复制到/data/local/文件夹下。 3)在手机的“终端”更改androidvncserver的权限,如下: 1.adb shell 2.#cd data/local/ 3.# chmod 777 androidvncserver 把权限改为只读和可执行。此步骤可以用Root Explorer直接操作。 4)运行androidvncserver,在手机的“终端”执行以下代码:   如下指定键盘和触摸屏设备,以免找不到kdb设备:   ./androidvncserver -k /dev/input/event0 -t /dev/input/event1   这样androidvncserver就启动服务了。 然后是电脑端的设置。 1)电脑安装VNC Client。装个免费的Real VNC Viewer即可。软件地址:http://www.realvnc.com/products/free/4.1/index.html 2)如果手机连上WiFi,并与电脑处于同一个局域网内,或者手机通过无线网卡恭喜网络给电脑。 在手机的“终端”运行 1.# busybox ifconfig -a 看到twifi0的IP地址是多少,例如:192.168.1.100。 在电脑上运行VNC Viewer,地址填写192.168.100 5901,点“确定”即可看到手机画面了。 3)如果手机于电脑是通过USB Tethering连接,即手机通过USB共享网络给电脑,或者电脑通过USB共享网络给手机。 在手机的“终端”运行 1.# busybox ifconfig -a 看到usb0的IP地址是多少,例如:192.168.77.254。 在电脑上运行VNC Viewer,地址填写192.168.77.254 5901,点“确定”即可看到手机画面了。 4)如果2、3的情况都不是,可以通过以下方式连接。 在电脑上执行以下命令: 1.adb forward tcp:5901 tcp:5901 然后打开VNC Viewer,地址填写127.0.0.1 5901,点“确定”即可看到手机画面了。 关闭手机上的androidvncserver服务 1)在手机的“终端”运行 1.# ps | grep /data/local/androidvncserver 显示的结果那一行中,root后面的数字就是进程号(pid),例如是8233。 2)执行
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值