Error in tightVNC viewer no connection could be made because the target machine actively refused it

nisha picture nisha · May 24, 2014 · Viewed 46.4k times · Source

I am using TightVNC viewer from Window7 to connect the Ubuntu machine. I got the error "Error in tightVNC viewer no connection could be made because the target machine actively refused it.

I do not have any firewall setup.

When i run, ps -ef | grep vnc:: i get

root      5265  4521  0 15:57 pts/1    00:00:00 sudo x11vnc -safer -localhost -nopw -accept popup:0 -once -viewonly -display :0
root      5266  5265  0 15:57 pts/1    00:00:00 x11vnc -safer -localhost -nopw -accept popup:0 -once -viewonly -display :0
mmm 5890  5269  0 16:06 pts/2    00:00:00 grep --color=auto vnc

On, x11vnc -forever -usepw -httpdir /usr/share/vnc-java/ -httpport 5800

23/05/2014 16:16:12 * XOpenDisplay failed (:0)

* x11vnc was unable to open the X DISPLAY: ":0", it cannot continue. * There may be "Xlib:" error messages above with details about the failure.

I am not sure where is the issue.

I tried connecting like, 171.69.35.33 171.69.35.33:5900 171.69.35.33::5901

f4rom tightvnc viewer.

ps aux | grep vnc 117 6125 2.1 8.3 4832760 679396 ? Sl 16:14 1:13 /usr/bin/kvm -S -M pc-1.0 -enable-kvm -m 4096 -smp 4,sockets=4,cores=1,threads=1 -name talon -uuid 33c53705-1847-e2a4-897d-436c39337179 -nodefconfig -nodefaults -chardev socket,id=charmonitor,path=/var/lib/libvirt/qemu/talon.monitor,server,nowait -mon chardev=charmonitor,id=monitor,mode=control -rtc base=utc -no-shutdown -drive file=/home/nso/build23-patch/talon-amd64-0.0.0.23_output/talon-amd64-0.0.0.23.qcow2,if=none,id=drive-ide0-0-0,format=qcow2 -device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 -drive file=/home/nso/build23-patch/talon-amd64-0.0.0.23_output/talon.iso,if=none,media=cdrom,id=drive-ide0-1-0,readonly=on,format=raw -device ide-drive,bus=ide.1,unit=0,drive=drive-ide0-1-0,id=ide0-1-0 -netdev tap,fd=18,id=hostnet0,vhost=on,vhostfd=19 -device virtio-net-pci,netdev=hostnet0,id=net0,mac=00:16:3e:36:ce:ec,bus=pci.0,addr=0x3,bootindex=2 -chardev socket,id=charserial0,host=127.0.0.1,port=2225,telnet,server,nowait -device isa-serial,chardev=charserial0,id=serial0 -usb -vnc 127.0.0.1:1 -vga cirrus -device intel-hda,id=sound0,bus=pci.0,addr=0x5 -device hda-duplex,id=sound0-codec0,bus=sound0.0,cad=0 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x7 mandnaya 6756 0.0 0.0 8112 896 pts/2 R+ 17:10 0:00 grep --color=auto vnc

Answer

nisha picture nisha · May 24, 2014
sudo apt-get install x11vnc

x11vnc -storepasswd

x11vnc -usepw

sudo x11vnc -xkb -noxrecord -noxfixes -noxdamage -display :0 -auth /var/run/lightdm/root/:0 -usepw

This solved my issue.