我想知道,是否有一个工具可以在 Ubuntu 桌面上运行,并通过远程桌面(或远程显示)应用程序连接到 Ubuntu Touch 设备,这样鼠标点击也会传播为设备上的点击(以及复制/粘贴文本)?
基本上,如果 Ubuntu Touch 使用 X11,那么我可以使用vinaigre
或xvnc4viewer
在 Ubuntu Desktop 上作为 VNC 客户端,并Vino
作为设备上的 VNC 服务器 - 但是,Ubuntu Touch 使用 Mir,而我实际上找不到有关通过 Mir 进行远程桌面/显示的任何信息。
那么,那里有类似的东西吗?
答案1
嗯,有一个部分解决方案 - 也就是说您可以查看屏幕,但不能通过鼠标控制它。我在phablet-screenshot
调试模式下运行时注意到了这一点,它报告说它使用了mirscreencast
手机上的一个程序。
关于此内容的更多信息,请参见https://wiki.ubuntu.com/Touch/ScreenRecording不过,我在 Youtube 上找到了最方便的命令行:
从 Ubuntu 手机实时屏幕录制 - mirscreencast 实时到电脑桌面。 - YouTube
开始传输(在设备上):
mirscreencast -m /run/mir_socket --stdout --cap-interval 1 -s 270 480 | gzip -c | nc 192.168.0.5 1234
接收传输(在台式电脑上):
nc -l -p 1234 | gzip -dc | mplayer -demuxer rawvideo -rawvideo w=270:h=480:format=rgba -
此外,https://github.com/ycheng/mir-vnc-server- 有点实验性,我设法让它在14.04手机上编译并运行,并且可以通过 VNC 客户端连接,但我无法获得屏幕的实时更新(仅显示第一帧,并且没有鼠标更新);这是我的笔记 - 不幸的是,并不完全完整,但给出了一个想法:
# in 64-bit Ubuntu 14.04:
# (/path/to/docker is general storage dir)
git clone https://github.com/ycheng/mir-vnc-server.git /path/to/docker/mir-vnc-server_git
sudo docker pull z3ntu/ubuntu-touch-build-env
sudo service docker start
sudo docker run -vit /path/to/docker/:/var/ubuntu_touch z3ntu/ubuntu-touch-build-env /bin/bash
sudo apt-get install gcc-arm-linux-gnueabi binutils-arm-linux-gnueabi
sudo apt-get install g++-arm-linux-gnueabi
sudo apt-get install g++-arm-linux-gnueabihf
sudo apt-get install libvncserver-dev # else dummyvncserver.c:3:21: fatal error: rfb/rfb.h: No such file or directory
sudo ln -s /usr/include/x86_64-linux-gnu/zconf.h /usr/include/ # else /usr/include/zlib.h:34:19: fatal error: zconf.h: No such file or directory
sudo apt-get install libmirclient-dev # else fatal error: mir_toolkit/mir_client_library.h: No such file or directory
sudo apt-get install libgles2-mesa-dev # else fatal error: EGL/egl.h: No such file or directory
# because of ..../arm-linux-gnueabi/bin/ld: cannot find -lvncserver:
apt-get source libvncserver0
apt-get source zlib1g
cd zlib-1.2.8.dfsg/
./configure
CC=arm-linux-gnueabi-gcc make
# should get: ./libz.so.1.2.8: ELF 32-bit LSB shared object, ARM, EABI5 version 1 (SYSV), dynamically linked, ...
cp -a *.so* /path/to/docker/libvncserver-0.9.9+dfsg/
cd ..
cd libvncserver-0.9.9+dfsg
aclocal
autoconf
autoheader
automake --add-missing
# ld: cannot find -lgcrypt, -lgnutls, -lws2_32; so:
# in configure, comment out 'LIBS="$LIBS -lws2_32"', and then:
LD_LIBRARY_PATH=${PWD} ./configure --host=arm-linux-gnueabi --without-gcrypt --without-gnutls
cd libvncserver/
CC=arm-linux-gnueabi-gcc make CFLAGS+="-DLIBVNCSERVER_HAVE_GETTIMEOFDAY -DLIBVNCSERVER_HAVE_LIBZ"
# should get: libvncserver/.libs/libvncserver.so.0.0.0: ELF 32-bit LSB shared object, ARM, EABI5 version 1 (SYSV), dynamically linked, ...
cp libvncserver/.libs/* /path/to/docker/mir-vnc-server_git/
cd /path/to/docker/mir-vnc-server_git/
LD_LIBRARY_PATH=${PWD} CC=arm-linux-gnueabi-gcc CXX=arm-linux-gnueabihf-g++ make
# here got stuck, and went on phone instead:
# http://askubuntu.com/questions/600065/consequences-of-using-apt-get-in-ubuntu-touch
# phablet-config writable-image
# more-less repeated the procedure above, but on the phone - possibly with some changes in Makefile and/or source files (unfortunately, lost)
# final linking command for executable had to be issued manually, it was:
g++ mirvncserver.o -o mirvncserver -L/usr/lib/arm-linux-gnueabihf -lpthread -lmircommon -lmirclient -lmirprotobuf -lEGL -lboost_program_options -lxcb-glx -lGLESv2 -lmirserver -lvncserver
# run like this - in a phone terminal shell:
# -s 270 480: WARNING: Width (270) is not a multiple of 4. VncViewer has problems with that.
./mirvncserver -m /run/mir_socket --cap-interval 2 -s 268 480
# then on desktop - use the IP address of the phone on the local network:
xvnc4viewer 192.168.XXX.YYY