docker内运行图形界面
docker内运行图形界面dorowu/ubuntu-desktop-lxde-vnc(可用浏览器访问桌面)
[https://www.cnblogs.com/xiao987334176/p/12290348.html]
获取镜像
docker pull dorowu/ubuntu-desktop-lxde-vnc
运行
docker run -d -p 6080:80 -p 590:59 -e VNC_PASSWORD=qsbye -v /dev/shm:/dev/shm dorowu/ubuntu-desktop-lxde-vnc:latest
宿主机:浏览器打开127.0.0.1:6080即可访问
密码为VNC_PASSWORD设置的
noVNC(基于web的VNC)
[https://zhuanlan.zhihu.com/p/427144657]
noVNC项目是通过取消VNC Client的安装,直接通过浏览器访问noVNC,然后由noVNC间接访问VNC server来达到client web化.
linux桌面环境
- gnome
- Xfce:轻量桌面环境
- MATE
- LXDE(LXQt):超轻桌面
docker内运行图形界面(on MacOS)
Mac宿主机:
brew install socat
brew install xquartz
配置Socat:
socat TCP-LISTEN:6000,reuseaddr,fork UNIX-CLIENT:"$DISPLAY"
注意这个进程一直是运行状态,不要中断它
配置Xquartz:
open -a Xquartz
重启Xquartz
查看ip:
ifconfig
运行镜像:
docker run -it -e DISPLAY=192.168.1.249:0 -v /Users/workspace/Downloads/hello:/tmp --privileged=true swr.cn-south-1.myhuaweicloud.com/openharmony-docker/openharmony-docker:1.0.0 /bin/bash
Docker容器内:
配置xwindow
apt update
apt install xserver-xorg
apt install x-window-system-core
dpkg-reconfigure xserver-xorg
apt install gnome-core
选择时区Asia Shanghai
apt install xdm
apt install ubuntu-desktop
apt install xscreensaver
apt install ttf-arphic*
宿主机
docker ps
docker restart [容器id]
docker attach [容器id]
Ubuntu
startx
报错:Fatal server error: no screens found
https://lists.debian.org/debian-laptop/2002/04/msg00070.html,https://segmentfault.com/q/1010000000177773/a-1020000000178028?sort=created怀疑是没有显卡设备
失败
apt install xarclock
xarclock