简体   繁体   English

从Docker运行VNC

[英]Running VNC from Docker

I am running a docker container that starts a vnc server. 我正在运行一个启动vnc服务器的docker容器。 I launch it with: 我用以下命令启动它:

docker run --rm -ti -p 5900:5900 rosdocker:latest

Is there a way, or how do I, control the virtual display resolution? 有没有办法控制虚拟显示分辨率? Nothing I've read mentions it, and it seems to be 1024x768 according to the display settings int the Ubuntu gui. 我读过的东西都没有提到它,根据Ubuntu gui的显示设置,它似乎是1024x768。 Is there a way to change it or is it hardwired somewhere? 有什么方法可以更改它,还是在某处进行硬接线?

Assuming your rosdocker image is based on "dorowu/ubuntu-desktop-lxde-vnc" and you keep its entrypoint. 假设您的rosdocker映像基于“ dorowu / ubuntu-desktop-lxde-vnc”,并且您保留其入口点。

when launching the container, you can use env RESOLUTION=1920x1080 to set the resolution. 启动容器时,可以使用env RESOLUTION=1920x1080设置分辨率。

Or if my assumption is wrong, add the following to your entrypoint script. 或者,如果我的假设是错误的,则将以下内容添加到您的入口点脚本中。

if [ -n "$RESOLUTION" ]; then
    sed -i "s/1024x768/$RESOLUTION/" /usr/local/bin/xvfb.sh
fi

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM