Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
x11vnc `stack smashing detected` solution.
# Install x-related to compile x11vnc from source code.
sudo apt-get update
sudo apt-get install -y libxtst-dev libssl-dev libjpeg-dev
# Grep source code.
wget http://x11vnc.sourceforge.net/dev/x11vnc-0.9.14-dev.tar.gz
gzip -dc x11vnc-0.9.14-dev.tar.gz | tar -xvf -
cd x11vnc-0.9.14/
./configure --prefix=/usr/local CFLAGS='-g -O2 -fno-stack-protector -Wall'
# Make and Make install.
make
make install
# Grep lighdm auth file.
ps wwwwaux | grep auth
# Run x11vnc.
/usr/local/bin/x11vnc -auth /var/run/lightdm/root/:0 -display :0 -xkb -forever -shared -rfbport 20000
# Use the chrome vnc client. Login Ubuntu and press ESC. Problems solved.
@pantaluna

This comment has been minimized.

Copy link

pantaluna commented May 22, 2017

Thanks. x11vnc works now on Ubuntu Zesty :)

@alhopper

This comment has been minimized.

Copy link

alhopper commented Oct 24, 2017

Awesome. Works exactly as written.
Thanks!!

@Azrael808

This comment has been minimized.

Copy link

Azrael808 commented Nov 24, 2017

This solution works on Fedora 27, albeit with a different pre-requisite install line:

sudo dnf install libXtst-devel openssl-devel libjpeg-devel

Only other gotcha is that I couldn't get the ./configure step to recognise the openssl libraries, but this isn't a massive issue for me as I'm tunnelling over an SSH connection.

@michielproce

This comment has been minimized.

Copy link

michielproce commented Nov 27, 2017

Debian/Ubuntu requirements:

sudo apt-get install libxtst-dev libssl-dev libjpeg-dev

(also didn't recognize openssl libraries, also didn't need them)

@flefebure

This comment has been minimized.

Copy link

flefebure commented May 18, 2018

You saved my day with a fresh Ubuntu 18.04 install
Thanks

@sywalters

This comment has been minimized.

Copy link

sywalters commented May 24, 2018

Lovely. Worked for Bionic Beaver too. Had to run "sudo make install" though. Thanks!

@ghost

This comment has been minimized.

Copy link

ghost commented Jun 1, 2018

Hi. I installed the new solution cause x11vnc closes randomly in a fresh 18.04 x64 Ubuntu. And I run this command at login but seems didn't works the -clip xinerama0 option cause it show both desktop when connecting. Is it because the new x11vnc version or am I doing something wrong?

/usr/local/bin/x11vnc -clip xinerama0 -auth /var/run/lightdm/root/:0 -display :0 -xkb -forever -shared -rfbport 5900

@pillsilly

This comment has been minimized.

Copy link

pillsilly commented Jan 11, 2019

this one really helps, good job!

@johnthomas22

This comment has been minimized.

Copy link

johnthomas22 commented Mar 7, 2019

Thanks!

@ethomas997

This comment has been minimized.

Copy link

ethomas997 commented Mar 13, 2019

Thanks for posting this. I was getting "stack smashing detected" disconnects with 'x11vnc-0.9.14-9.fc29.x86_64' on Fedora 29, and fixed it by building a new binary of x11vnc-0.9.16 and swapping it in; these are the commands I used:

sudo dnf install libXtst-devel openssl-devel libjpeg-devel
sudo dnf install autoconf automake libvncserver-devel
wget https://codeload.github.com/LibVNC/x11vnc/tar.gz/0.9.16 -O x11vnc-0.9.16.tar.gz
gzip -dc x11vnc-0.9.16.tar.gz | tar -xvf -
cd x11vnc-0.9.16
sh autogen.sh
./configure --prefix=/usr/local CFLAGS='-g -O2 -fno-stack-protector -Wall'
make
sudo cp src/x11vnc /usr/bin/
sudo chown root:root /usr/bin/x11vnc
@ethomas997

This comment has been minimized.

Copy link

ethomas997 commented Mar 23, 2019

These are commands I used on Linux Mint 19.1 to build a new binary of x11vnc-0.9.16 and swap it in:

sudo apt-get update
sudo apt-get install -y libxtst-dev libssl-dev libjpeg-dev
sudo apt-get install autoconf automake libvncserver-dev
wget https://codeload.github.com/LibVNC/x11vnc/tar.gz/0.9.16 -O x11vnc-0.9.16.tar.gz
gzip -dc x11vnc-0.9.16.tar.gz | tar -xvf -
cd x11vnc-0.9.16
sh autogen.sh
./configure --prefix=/usr/local CFLAGS='-g -O2 -fno-stack-protector -Wall'
make
sudo cp src/x11vnc /usr/bin/
sudo chown root:root /usr/bin/x11vnc
@kenysc99

This comment has been minimized.

Copy link

kenysc99 commented Apr 1, 2019

Thanks, in a Ubuntu 18.04.02 I need to install 2 more packages libssl1.0-dev zlib1g-dev to avoid the missing lib warnings. And yes I'm auto starting x11vnc as a system service

sudo apt-get update
sudo apt-get install -y libxtst-dev libssl-dev libjpeg-dev libssl1.0-dev zlib1g-dev
wget http://x11vnc.sourceforge.net/dev/x11vnc-0.9.14-dev.tar.gz
gzip -dc x11vnc-0.9.14-dev.tar.gz | tar -xvf -
cd x11vnc-0.9.14/
./configure --prefix=/usr/local CFLAGS='-g -O2 -fno-stack-protector -Wall'
make
sudo systemctl stop x11vnc.service
sudo cp ./x11vnc/x11vnc /usr/bin
sudo systemctl daemon-reload
sudo systemctl start x11vnc.service
@uku69

This comment has been minimized.

Copy link

uku69 commented Apr 20, 2019

@ethomas997:
thank you; that's the solution for Linux Mint 19.1 Tessa.
But - I hat to add also following packages before autogen:

sudo apt-get install autoconf libssl-dev xorg-dev libvncserver-dev

Now it's working...

@frzleaf

This comment has been minimized.

Copy link

frzleaf commented Mar 30, 2020

Thanks a lot!
It worked on my machine Linux Mint 19.1 Cinnamon

@frzleaf

This comment has been minimized.

Copy link

frzleaf commented Mar 30, 2020

make install should be in sudo mode

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.