本文共 11958 字,大约阅读时间需要 39 分钟。
转载自:
2017-06-20 23:46:06 6393
分类专栏: 文章标签:
版权
ROS在线练习课程正在逐步完善中,目前以ROS官网中文资料制作,可参考:
邀请码 U23ERF8H
安装Ubuntu+ROS对于零Linux基础的小伙伴有些困难,最近发现了一个学习Linux非常好的网站实验楼,链接如下:
非常好奇如何实现了,于是查阅了一些资料,觉得最好的如下:
1
2
3
4
4.1
4.2
4.3
----~~~~----
ubuntu-desktop-lxde-vnc
relaybot@relaybot-desktop:~$ docker search dorowu
NAME DESCRIPTION STARS OFFICIAL AUTOMATED
dorowu/ubuntu-desktop-lxde-vnc Ubuntu with openssh-server and NoVNC 114 [OK]
dorowu/ubuntu-ssh-ttyjs Ubuntu with openssh server and tty.js enab... 8 [OK]
dorowu/apt-repo-server apt-repo-server is a debian repository ser... 6 [OK]
dorowu/ubuntu-lxqt-vnc 5 [OK]
dorowu/qemu-iso Boot VM by QEMU/KVM with ISO and access it... 4 [OK]
dorowu/lightop-ubuntu-trusty-ttyjs 2 [OK]
dorowu/ntopng 1 [OK]
hardock14/dorowu-docker-ubuntu-vnc-desktop dorowus images with additional software 1 [OK]
dorowu/online-document.amd64 0
dorowu/lightop-ubuntu-trusty-lxde 0 [OK]
dorowu/qdk2 Create Docker App on QNAP NAS in QPKG format 0 [OK]
dorowu/glusterfs-keepalived 0 [OK]
dorowu/lightop 0 [OK]
dorowu/pekaboo2qnap 0
dorowu/ubuntu_amd64 0
dorowu/nodejs_amd64 0
dorowu/ruby_amd64 0
dorowu/ubuntu_armhf 0
dorowu/qiot-mongodb_amd64 0
dorowu/qdk2-build 0
dorowu/qiot-mongodb_armhf 0
dorowu/dashing 0
dorowu/supershell 0
dorowu/mattermostdocker_db 0
dorowu/qiot-mongo-express_amd64 0
relaybot@relaybot-desktop:~$ docker pull dorowu/ubuntu-desktop-lxde-vnc
Using default tag: latest
latest: Pulling from dorowu/ubuntu-desktop-lxde-vnc
aafe6b5e13de: Pull complete
0a2b43a72660: Pull complete
18bdd1e546d2: Pull complete
8198342c3e05: Pull complete
f56970a44fd4: Pull complete
da6ac41ac9c8: Pull complete
6f3a5e5efdea: Downloading [============> ] 111.4MB/441.9MB
d9dd7dde4295: Download complete
ab365adf65d2: Download complete
06b2cd083c64: Download complete
c524c4444fb2: Download complete
relaybot@relaybot-desktop:~$ docker search ros
NAME DESCRIPTION STARS OFFICIAL AUTOMATED
mono Mono is an open source implementation of M... 233 [OK]
ros The Robot Operating System (ROS) is an ope... 111 [OK]
aerospike Aerospike – the reliable, high performance... 76 [OK]
cirros CirrOS is a Tiny OS that specializes in ru... 38 [OK]
neurodebian NeuroDebian provides neuroscience research... 36 [OK]
osrf/ros The Robot Operating System (ROS) is an ope... 28 [OK]
quantumobject/docker-ros-base ROS-Base container (Robot Operating System) 5 [OK]
px4io/px4-dev-ros Container with PX4 tool chain and SITL sim... 3 [OK]
px4io/px4-ros-full 2 [OK]
virgiletn/docker-ros Set of usefull tools for running ros throu... 1 [OK]
personalrobotics/ros-openrave ROS Indigo Base + Personal Robotics OpenRAVE 1 [OK]
kaixhin/vnc-ros Ubuntu Core 14.04 + LXDE desktop + Firefox... 1 [OK]
shadowrobot/ubuntu-ros-indigo-build-tools DEPRECATED!!! Ubuntu 14.04 ROS Indigo imag... 0 [OK]
autharl/ros ROS images 0 [OK]
timn/fedora-ros Robot Operating System (ROS) on Fedora 0 [OK]
harmish/ros Images of ROS (Robot Operating System) 0 [OK]
jacknlliu/tiago-ros A tiago robot ros development environment. 0 [OK]
kaixhin/ros Ubuntu Core 14.04 + ROS Jade Base. 0 [OK]
pmallozzi/ros Ros 0 [OK]
nhzio/ros-weave rancheros weave + iptables 0 [OK]
ivs0/b-ros Jenkins builder for ROS 0 [OK]
mjenz/ros-datacollection A container based on mjenz/ros-indigo-perc... 0 [OK]
jacknlliu/ros ROS desktop-full docker images with Qt C++... 0 [OK]
sigproc/ros 0 [OK]
diegoferigo/ros Dockerfile for my ROS Kinetic desktop-full... 0 [OK]
relaybot@relaybot-desktop:~$ docker pull ros
Using default tag: latest
latest: Pulling from library/ros
bd97b43c27e3: Waiting
6960dc1aba18: Waiting
2b61829b0db5: Waiting
1f88dc826b14: Waiting
73b3859b1e43: Waiting
27d60414a57e: Waiting
d93e52c3383b: Waiting
357b9c9b1672: Waiting
e7c791091ba5: Waiting
a55e61abbe79: Waiting
3bdd92756f16: Waiting
a75e7cd84889: Waiting
^C
relaybot@relaybot-desktop:~$ docker pull kaixhin/vnc-ros
Using default tag: latest
latest: Pulling from kaixhin/vnc-ros
16da43b30d89: Pull complete
1840843dafed: Pull complete
91246eb75b7d: Pull complete
7faa681b41d7: Pull complete
97b84c64d426: Pull complete
f6f12794daea: Downloading [==========> ] 44.32MB/204.3MB
e7841d035bd3: Download complete
440e2abbd651: Download complete
09e4cb06ebb5: Download complete
067189fe4086: Download complete
52c18283b71e: Download complete
49495db30f44: Download complete
32e45df178f9: Downloading [=> ] 20.52MB/629.6MB
a138ae9132ab: Waiting
15247c05ac4a: Waiting
----~~~~----
当镜像完全下载后可以进行查看,如下:
relaybot@relaybot-desktop:~$ docker images -a
REPOSITORY TAG IMAGE ID CREATED SIZE
dorowu/ubuntu-desktop-lxde-vnc latest ec8a8836ea5f 6 weeks ago 1.23GB
kaixhin/vnc-ros latest 0948d9f58857 5 months ago 2.71GB
relaybot@relaybot-desktop:~$ docker run -it --rm -p 6080:80 dorowu/ubuntu-desktop-lxde-vnc
/usr/lib/python2.7/dist-packages/supervisor/options.py:297: UserWarning: Supervisord is running as root and it is searching for its configuration file in default locations (including its current working directory); you probably want to specify a "-c" argument specifying an absolute path to a configuration file for improved security.
'Supervisord is running as root and it is searching '
2017-06-20 23:01:40,847 CRIT Supervisor running as root (no user in config file)
2017-06-20 23:01:40,847 WARN Included extra file "/etc/supervisor/conf.d/supervisord.conf" during parsing
2017-06-20 23:01:40,869 INFO RPC interface 'supervisor' initialized
2017-06-20 23:01:40,870 CRIT Server 'unix_http_server' running without any HTTP authentication checking
2017-06-20 23:01:40,870 INFO supervisord started with pid 19
2017-06-20 23:01:41,873 INFO spawned: 'xvfb' with pid 26
2017-06-20 23:01:41,876 INFO spawned: 'pcmanfm' with pid 27
2017-06-20 23:01:41,879 INFO spawned: 'lxpanel' with pid 28
2017-06-20 23:01:41,882 INFO spawned: 'lxsession' with pid 29
2017-06-20 23:01:41,884 INFO spawned: 'x11vnc' with pid 30
2017-06-20 23:01:41,887 INFO spawned: 'novnc' with pid 31
2017-06-20 23:01:41,971 INFO exited: lxsession (exit status 1; not expected)
2017-06-20 23:01:41,994 INFO exited: lxpanel (exit status 1; not expected)
2017-06-20 23:01:42,951 INFO success: xvfb entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2017-06-20 23:01:42,951 INFO success: pcmanfm entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2017-06-20 23:01:42,951 INFO success: x11vnc entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2017-06-20 23:01:42,951 INFO success: novnc entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2017-06-20 23:01:42,973 INFO spawned: 'lxsession' with pid 52
2017-06-20 23:01:43,055 INFO spawned: 'lxpanel' with pid 54
2017-06-20 23:01:44,106 INFO success: lxpanel entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2017-06-20 23:01:44,106 INFO success: lxsession entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2017-06-20 23:01:58,177 INFO waiting for novnc, pcmanfm, lxpanel, xvfb, x11vnc, lxsession to die
2017-06-20 23:01:58,463 INFO stopped: novnc (terminated by SIGQUIT (core dumped))
2017-06-20 23:01:58,465 INFO stopped: x11vnc (exit status 2)
2017-06-20 23:01:58,669 INFO stopped: lxsession (terminated by SIGABRT (core dumped))
2017-06-20 23:01:59,871 INFO stopped: lxpanel (terminated by SIGQUIT (core dumped))
2017-06-20 23:02:00,056 INFO stopped: pcmanfm (terminated by SIGQUIT (core dumped))
2017-06-20 23:02:00,060 INFO stopped: xvfb (exit status 1)
2017-06-20 23:02:00,076 CRIT Supervisor running as root (no user in config file)
2017-06-20 23:02:00,076 WARN Included extra file "/etc/supervisor/conf.d/supervisord.conf" during parsing
2017-06-20 23:02:00,077 INFO RPC interface 'supervisor' initialized
2017-06-20 23:02:00,077 CRIT Server 'unix_http_server' running without any HTTP authentication checking
2017-06-20 23:02:00,077 INFO supervisord started with pid 19
2017-06-20 23:02:00,867 INFO spawned: 'xvfb' with pid 75
2017-06-20 23:02:00,870 INFO spawned: 'pcmanfm' with pid 76
2017-06-20 23:02:00,873 INFO spawned: 'lxpanel' with pid 77
2017-06-20 23:02:00,878 INFO spawned: 'lxsession' with pid 78
2017-06-20 23:02:00,881 INFO spawned: 'x11vnc' with pid 79
2017-06-20 23:02:00,884 INFO spawned: 'novnc' with pid 80
2017-06-20 23:02:01,913 INFO success: xvfb entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2017-06-20 23:02:01,914 INFO success: pcmanfm entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2017-06-20 23:02:01,914 INFO success: lxpanel entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2017-06-20 23:02:01,914 INFO success: lxsession entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2017-06-20 23:02:01,914 INFO success: x11vnc entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2017-06-20 23:02:01,914 INFO success: novnc entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
Docker图像提供HTML5 VNC界面访问Ubuntu 16.04 LXDE桌面环境。
运行码头图像并打开端口 6080
docker run -it --rm -p 6080:80 dorowu/ubuntu-desktop-lxde-vnc
浏览
<img src =“https://raw.github.com/fcwu/docker-ubuntu-vnc-desktop/master/screenshots/lxde.png?v1”width = 700 />
将VNC服务端口5900转发到主机
docker run -it --rm -p 6080:80 -p 5900:5900 dorowu/ubuntu-desktop-lxde-vnc
现在,打开vnc查看器并连接到端口5900.如果要通过密码保护vnc服务,请设置环境变量VNC_PASSWORD
,例如
docker run -it --rm -p 6080:80 -p 5900:5900 -e VNC_PASSWORD=mypassword dorowu/ubuntu-desktop-lxde-vnc
提示将在浏览器或vnc查看器中询问密码。
获取IP信息:
两种方法:
1 $ docker exec ec8a8836ea5f ifconfig eth0 | grep "inet addr:"
注意,ec8a8836ea5f为ID,依据实际情况进行调整。
relaybot@relaybot-desktop:~$ docker exec fdfc8eda1 ifconfig eth0 | grep "inet addr:"
inet addr:172.17.0.2 Bcast:0.0.0.0 Mask:255.255.0.0
relaybot@relaybot-desktop:~$ ifconfig -a
docker0 Link encap:Ethernet HWaddr 02:42:16:25:5a:77
inet addr:172.17.0.1 Bcast:0.0.0.0 Mask:255.255.0.0
inet6 addr: fe80::42:16ff:fe25:5a77/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:21801 errors:0 dropped:0 overruns:0 frame:0
TX packets:31279 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:6093261 (6.0 MB) TX bytes:30175014 (30.1 MB)
enp3s0 Link encap:Ethernet HWaddr 20:6a:8a:03:40:6b
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
Interrupt:16
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:23603 errors:0 dropped:0 overruns:0 frame:0
TX packets:23603 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1
RX bytes:6543144 (6.5 MB) TX bytes:6543144 (6.5 MB)
vethd735054 Link encap:Ethernet HWaddr f6:0a:d2:7f:58:70
inet6 addr: fe80::f40a:d2ff:fe7f:5870/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:21801 errors:0 dropped:0 overruns:0 frame:0
TX packets:31319 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:6398475 (6.3 MB) TX bytes:30180429 (30.1 MB)
wlp5s0 Link encap:Ethernet HWaddr 70:f1:a1:ca:75:52
inet addr:192.168.1.101 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::3c12:a5b2:8cf9:246/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1167103 errors:0 dropped:0 overruns:0 frame:0
TX packets:965289 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1572330174 (1.5 GB) TX bytes:97246007 (97.2 MB)
2 在novnc网页中启动命令行ifconfig -a
----vnc-ros----
参考资料:
----https://hub.docker.com/r/kaixhin/vnc-ros/----
简短的介绍
Ubuntu Core 14.04 + LXDE桌面+ Firefox浏览器+ TightVNC服务器+ ROS Jade Desktop Full。
完整描述
Ubuntu Core 14.04 + LXDE桌面+ Firefox浏览器+ TightVNC服务器+ 。默认使用尾部运行作为守护进程。