X11vnc server exits when I close tightVNC viewer - x11

I followed this blog to set up a VNC connection from my Windows 8 laptop to my BeagleBone Black.
Digital Diner: Quick hint for Beaglebone Black user
It works well except for one problem: the X11VNC server on the Beagle Bone Black exits when I close the TightVNC Viewer on my laptop. I have to connect a remote terminal to the BBB using PuTTY and run the command given in the blog in order to reconnect.
Any suggestions on how to keep the server from exiting when I close the TightVNC viewer connection on my laptop? Is there a way to always have the X11vnc server running on the Beagle Bone Black so I can connect anytime?

I found the answer here: BeagleBone Black Google Group.
The key is to add -forever to the end of the command to start the X11vnc server.
x11vnc -bg -o %HOME/.x11vnc.log.%VNCDISPLAY -auth /var/run/gdm/auth-for-gdm*/database -display :0 - forever - nopw
I also added this command to the start up applications. System --> Preferences --> Startup Applications

Related

Script does not work the same way in terminal than launched in a service

I have a script to test and make connection via Wifi. It works pretty fine for WEP and WPA2 AP when launched directly in the terminal.
But when the script is launched via a service I get a "deauthenticating by local choice" almost instantly when connecting to WPA2 AP.
Here is the script :
systemctl stop dnsmasq
systemctl stop hostapd
systemctl disable hostapd
ifdown wlan0
killall wpa-supplicant
ifup --force wlan0=wlan_orange
sleep 30
Thanks in advance for any help.
EDIT
I try to add a "sudo" to my ifup command but he has not shown any results.
EDIT 2
Long term test does not show any problems on WEP connection. I suspect that the problem may come from a network setup but I don't know where to start to look at.
EDIT 3
I found out that the deconnection appears after the end of the sleep. I confirmed it after several tries with different time.

Put a Windows 10 pc remotely to hibernate from a raspberrypi

I'm running homeassistant on a RaspberryPi3 in my local network and what I want to achieve is a switch inside homeassistant to switch on and off my computer (Win10)
Apparently my Desktop PC does not support Wake on LAN from a real "shutdown" to S5, so I'm looking for a solution to remotely hibernate it
What I've done/achieved so far:
- Wake on LAN is working when I manually shutdown with shutdown /h
- remote shutdown is working with net rpc shutdown -I IPADDRESS -U USERNAME%PASSWORD
What I've also tried, but failed:
- running a sshd on Windows (tried with cygwin and openssh port) but failed to start
So the core questions would be either
- If I can manage to put the Windows machine to hibernate instead of shutdown from remote
or
- manage to get WOL working with a completely shutdown machine
Though, Solution 1 would be more convenient to me
Thanks in Advance for any help/hints
I am in the same boat (Home Assistant on a Pi, need to hibernate a Windows computer). I installed this tool from Github on the Windows PC. It's a program that listens for GET requests on a specified port, and will Shutdown, Restart, and Hibernate the host Windows computer.
Now, whenever I send a GET to http://windows.computer.IP.address:PORT/SECRET/ the computer hibernates.

Docker unreachable after computer sleep

I have just installed docker using docker-toolbox 1.8.2 on Windows 10.
Due to due to this issue I had to recreate the docker image using these commands
docker-machine rm default
docker-machine --native-ssh create -d virtualbox default
After that it has been working fine, except for one problem:
When the PC has gone to sleep and then wakes again, the docker commands can no longer connect. Example:
> docker images
An error occurred trying to connect: Get https://192.168.99.100:2376/v1.20/images/json:
dial tcp 192.168.99.100:2376: ConnectEx tcp: A connection attempt failed because the
connected party did not properly respond after a period of time, or established connection
failed because connected host has failed to respond.
However the docker-machine lists the machine as running:
> docker-machine ls
NAME ACTIVE DRIVER STATE URL SWARM
default * virtualbox Running tcp://192.168.99.100:2376
I can also confirm in VirtualBox that the VM screen seems to be active.
I have tried starting and stopping the machine, but that does not help
C:\x> docker-machine stop default
C:\x> docker-machine start default
Starting VM...
Started machines may have new IP addresses. You may need to re-run the `docker-machine env` command.
C:\x> docker-machine env default --shell=powershell
Ironically, the last command hangs, so I never get any environment settings.
The only thing that helps is to restart the whole PC. But that should be unnecessary?
I have also posted this as an issue on the docker github repository,but that was closed. A related issue seems to be this one, but no workaround or solution has been posted for Windows.
After hous of fighting with VirtualBox + Docker Toolbox, I finally found the way, how to make Docker working again (even without restarting all the containers):
Wake up PC from sleep
Try docker images (won`t work)
Open VirtualBox -> Close VM with saving state (CTRL+V)
Run your VM again
Try docker images again (now should work)
Please note: All steps are in VirtualBox only! Running docker-machine restart default will create another host-only adapter, which is something you do not want. If you did it anyway, delete all additionally created adapters (File->Preferences->Network on VirtualBox), then follow steps 1-5.
I have experienced the exact same symptoms on Windows 8.1... The thing is that it's not really a docker-specific issue, but more how Windows manages the VirtualBox network adapters after sleep (I think...). The culprit in my case is that the network adapter's addresses were becoming private after sleep (they became 169.* addresses).
Credits to this guy who gave me the idea: http://lyngtinh.blogspot.ca/2011/12/how-to-disable-autoconfiguration-ipv4.html
Fix:
Start a command prompt as Administrator
Find out the "useful" network adapters: ipconfig /all. The useful ones in my case were the ones labeled "VirtualBox Host-Only Ethernet Adapter" that didn't have private ips (not starting with 169.*).
Run this command and note the "Idx" of the useful VirtualBox network adapters: netsh interface ipv4 show inter.
Run this command to disable the IP auto configuration: netsh interface ipv4 set interface <idx> dadtransmits=0 store=persistent. Replace <idx> with each index found in the previous step.
Restart Windows
Afterwards, I was able to docker-machine start default, then docker-machine env default --shell cmd, put the PC to sleep, wake up and run docker-machine env default --shell cmd again.
I found that removing 'host only adapter' (File->Preferences->Network on VirtualBox), and restart the docker-machine helps.
Not a real solution. But probably better over restart the computer.
Having tried all the other answers here, and having varying but not consistent success, the following seems to reliably bring it back for me after this problem occurs.
Open a powershell/command window (I have most success if I run all docker-machine commands in a powershell window opened as administrator, I don't know if that's important or not) then run (where "dev" is the name of your docker machine instance):
docker-machine ssh dev
Then on the terminal that is opened, run:
sudo shutdown -r now
When the machine restarts, it seems to refresh the network and work correctly. Note, however, that simply running docker-machine restart dev did not have the same effect for me.
Your machine needs to be running before you can do the ssh, so if it's not running, execute docker-machine start dev before trying to SSH.
Had the same problem on Windows 8.1 and docker toolbox 1.12.0
None of the above solutions worked for me, too.
[edited]
Found another way to make docker work after system wake up:
In the docker Quickstart Terminal window, stop docker process Ctrl-C (if it is still running)
Run command docker-compose down
Shut down docker with docker-machine stop default
Exit terminal window Ctrl-D
Run Quickstart Terminal again and do all subsequent steps you need.
This worked for me, on Windows host machine.
Configure your network adapter to
1) Allow the network adapter to wake the computer,
2) Allow a magic packet to wake the computer,
3) Allow IPV6
http://www.worldstart.com/dropped-internet-connection-in-sleep-mode/
Also, on virtual box network settings, go to advanced, and allow promiscuous mode to VM machines, or allow all

Build a full Ubuntu desktop docker image

I want to build a full version of Ubuntu 14 desktop as the base image for gui applications, I know how to build on the Ubuntu desktop version by the debootstrap, as described in https://docs.docker.com/articles/baseimages/, but that is a minimal Linux version and some GUI application cannot run perfectly, because there are some basic components missing, such as a font family, so I want the full control of a basic image, thanks!
fcwu/docker-ubuntu-vnc-desktop
https://github.com/fcwu/docker-ubuntu-vnc-desktop provides a convenient setup:
docker run --name ubvnc -p 6080:80 -p 5900:5900 dorowu/ubuntu-desktop-lxde-vnc:bionic
Then either:
visit: http://127.0.0.1:6080/#/ which runs a noVNC more limited JavaScript VNC client
run:
sudo apt-get install tigervnc-viewer
xtigervncviewer :5900
Then inside vinagre, you might want to go into full screen mode to be able to see the full desktop
I also tried vinagre, but it was much laggier when scrolling Firefox on YouTube.
To quit just kill docker on the terminal. And to restart the machine
docker start ubvnc
and then reconnect with VNC. Then to quit the machine:
docker stop ubvnc
You have to wait a few seconds for the VNC server on the guest to start before you can connect.
Chromium won't start from the menu. If you try to launch it from the command line it explains why:
Running as root without --no-sandbox is not supported. See https://crbug.com/638180.
Firefox does not care however.
TODO: no audio. --device /dev/snd did not help:
How to play sound in a docker container
https://forums.docker.com/t/how-to-get-sound/36527
https://github.com/fcwu/docker-ubuntu-vnc-desktop/issues/49
See also:
Can you run GUI applications in a Docker container?
How to open Ubuntu GUI inside a Docker image
Tested on Ubuntu 19.04 host, fcwu/docker-ubuntu-vnc-desktop, dorowu/ubuntu-desktop-lxde-vnc image id: 70516b87e92d.
I don't see the benefits of it, but impossible n'est pas français (impossible isn't French).
Docker Desktop is a way that will give you an X11 server to connect on using SSH.
This Dockerfile creates a docker image and once it's executed it creates a container that runs X11 and SSH services. The ssh is used to forward X11 and provide you encrypted data communication between the docker container and your local machine.

tightvnc black screen server Fedora 13 , client windows XP

I get a black screen with the above setup. I have tried RealVNC and TigerVNC clients too on windows with the same result.
Any ideas?
Thanks
It's possible your VNC server is running, but there is nothing running in it; no window manager, no desktop environment (GNOME), etc.
That probably means you ran the VNC server directly without using some of the friendly wrapper scripts such as vncserver. For example, if you run Xtightvnc directly, that's what you'll get.
For example, on Ubuntu I usually start a VNC session (or port 5901) like this which starts the VNC/X-server and the normal desktop environment:
vncserver -geometry 1024x768 :1
On Ubuntu vncserver is a link to tightvncserver. If you don't have vncserver on Fedora 13 then try tightvncserver.

Resources