Friday, January 10, 2020

remote desktop - Cannot connect to x11vnc server before login


I have installed x11vnc on ubuntu 15.10. Based on:


Remmina cannot perform VNC remote desktop session before user logs in


I have created a new file: /etc/init/x11vnc.conf on MYSERVER containing:


start on login-session-start
script
x11vnc -display :0 -auth /var/run/lightdm/root/:0 -loop -forever -safer -shared -ultrafilexfer -bg -o /var/log/x11vnc.log -rfbauth /home/moore/.vnc/passwd -rfbport 5903 -http -users moore -nowireframe
end script

I have now rebooted MYSERVER and am trying to RDP to it from another ubuntu machine using Remmina:


enter image description here


But I just get:


enter image description here


I also tried following this guide:


http://seb.so/vnc-from-boot-without-logging-in-ubuntu-lubuntu-xubuntu-and-mint-lmde/


same result.


UPDATE:


As suggested below I have now tried to run:


x11vnc -display :0 -auth /var/run/lightdm/root/:0 -loop -forever -safer -shared -ultrafilexfer -bg -o /var/log/x11vnc.log -rfbauth /home/moore/.vnc/passwd -rfbport 5903 -http -users moore -nowireframe

from a terminal where I first SSH'ed to the server. It gave me this error:


...disabling -bg in -loop mode error opening logfile: /var/log/x11vnc.log open: Permission denied

But if I then do it as root from the same terminal it now works! But why does it not do that automatically when the machine is rebooted?


Notice when I did the small manual test above as root the file /var/log/x11vnc.log was created so it now exists with the following permissions:


-rw-r--r--  1 root              root     12640 Feb 19 00:26 x11vnc.log

But it still fails to start automatically on boot. It seems that whatever user is running the script on boot is NOT root.


UPDATE2:


The updated below answer solved the problem - that addresses the issue in Ubuntu 15.10.



There are only three things I can think of that might be preventing you from connecting:



  1. Do you have a firewall in place? Have you unblock access to port 5903? You can do that using UFW which is a GUI for your firewall in Ubuntu.

  2. Are you trying to access the server from outside your network? In that case you also have to forward the 5903 port on your router to access the VNC server (in addition to point 1). If you are getting this error when connecting from the same network, ignore this option but keep it in mind when connecting from outside the network.

  3. Last one, which is silly but I wanted to cover my bases. Are you trying to connect from the same computer? I don't think x11vnc allows for loopback connections, so always try use a different computer when testing (or your phone).


I also use x11vnc server on my computer, but the difference is that only the localhost can access it. I also run an SSH server, that way I have a way more secure connection, and once a user ssh to your computer, they can connect to the VNC server as a localhost.


I hope this helps


EDIT


After trableshooting, the problem is that Ubuntu 15.10 doesn't have upstart so x11vnc will never run on boot.
Instead, you have to create a service and make it available at boot. Here's what to do:


sudo nano /lib/systemd/system/x11vnc.service

Insert this into the file:


[Unit]
Description="x11vnc"
Requires=display-manager.service
After=display-manager.service
[Service]
ExecStart=/usr/bin/x11vnc -display :0 -auth guess -loop -forever -safer -shared -ultrafilexfer -bg -o /var/log/x11vnc.log -rfbauth /home/moore/.vnc/passwd -rfbport 5903 -http -users moore -nowireframe
ExecStop=/usr/bin/killall x11vnc
[Install]
WantedBy=multi-user.target

Then you can start the service with:


sudo systemctl daemon-reload
sudo systemctl start x11vnc

And to make the service start on boot:


sudo systemctl enable x11vnc

This solution was previously posted by babelmonk here


Thursday, January 9, 2020

boot - How to restore Ubuntu GNU GRUB screen?

I installed Ubuntu 18.04.1 LTS on my system along with Windows 10 as dual boot. The Ubuntu worked fine for few days, but last day there there were some updates in UBUNTU which I allowed to download and install. During that, my Ubuntu freeze with no mouse and keyboard working, so ultimately I had to force shutdown the system holding power key.
During next boot to the system, the system automatically got booted to Windows 10 with no GNU GRUB Boot loader missing. I tried few solutions from web, but nothing worked for me. I'll post details of solutions I already tried.
I tried boot repair using temporary booting of Ubuntu using flash drive but it also got failed and resulted in dpkg error.



sudo add-apt-repository ppa:yannubuntu/boot-repair
sudo apt-get update
sudo apt-get install -y boot-repair && boot-repair


The error is dpkg-error detected. Please open a terminal then type




sudo chroot "/mnt/boot-sav/sda12" dpkg --configure -a 


On typing this command on terminal, error is



chroot:failed to run command


Is there any possible solution to restore Ubuntu without loosing data.




I tried removing Ubuntu from my machine with fixing Windows boot loader from CMD in Windows Recovery mode, but it's also showing Access Denied using bootrec /fixboot command.



Currently Windows is working fine on system but it's taking time to load up as I messed with boot settings by installing Ubuntu.



Any possible method to restore Ubuntu?
If not, how to fix my Windows System, so that I can install Ubuntu again.

partitioning - How do I resize my current ubuntu partition?

I've got Ubuntu 10.10 installed to use my whole hard-disk, but would like to use the 130GB of free space I've got to create a new partition and do some development on Unity and Natty.


Can I use gparted to do this? If so how?

Wednesday, January 8, 2020

directory - how to delete locked folders/files




How to delete locked folders/files? When I try to delete them an error occurs: "Error removing file: Permission denied" I am root. See the image below to know what kind of folders/files.



enter image description here



thanks



Launch your file explorer as root using:



gksudo nautilus



This will open your file explorer, and grant it root, so it should be able to view/delete the directory/file.



If you are like me, and don't care about the warnings in this question you can use this instead:



sudo nautilus

software installation - I cannot install any application anymore

After installing wine and failed to agree on the agreement on the font.
this message is shown, and I cannot install or remove the ttf-mscorefonts-installer anymore.



The package 'ttf-mscorefonts-installer' is in an inconsistent state and needs to be re-installed, but no archive can be found for it. 



I use this command first to re install the 'ttf-mscorefonts-instaler'



sudo apt-get --reinstall install ttf-mscorefonts-installer


This error message shows.



Reading package lists... Done 

Building dependency tree
Reading state information... Done
E: The package ttf-mscorefonts-installer needs to be reinstalled, but I can't find an archive for it.


and using this command "sudo apt-cache policy ttf-mscorefonts-installer" this error message shows.




Installed: 3.4ubuntu3
Candidate: 3.4ubuntu3

Version table:
*** 3.4ubuntu3 0
100 /var/lib/dpkg/status
3.3ubuntu4 0
500 http://archive.ubuntu.com/ubuntu/ oneiric/multiverse amd64 Packages


and with this command "sudo dpkg-reconfigure ttf-mscorefonts-installer" this message shows.





/usr/sbin/dpkg-reconfigure: ttf-mscorefonts-installer is broken or not fully installed


how to solve this problem??

multiple monitors - Multimonitor on AMD Catalyst and 11.10 feels slowish

I have an AMD X6 desktop with plenty of RAM and a dual LG monitors driven by a Radeon HD 5830. The monitors are on DVI ports. AMD Catalyst Version 11.11. Tear free is on. Sync to V-black in ccsm, is disabled.



Multi monitor works OK, I have no problems dragging applications, working seemless between the two monitors, no instability issues whatsoever.




However, the whole experience with dual monitors is a bit sluggish. Window maximizing and minimizing feels slow, effects feel slower, the whole desktop experience feels other than on a single monitor.



Is this an Ubuntu issue or a GPU issue? Is there something to do to improve the overall experience? Will 12.04 improve on these issues?
Thanks

Tuesday, January 7, 2020

npm - Installing Current nodejs version

Starting to learn Nodejs in Ubuntu (New to ubuntu as well). when I use apt install nodejs , v8.x.x is getting installe instead of current v12.x.x.
I tried to use nvm using from here but it is only installing node and not nodejs.


I tried to install from nodejs.org but it's just installing a tar package and I'm not sure how to install it or even if I'm able to install, do not find any easy way to update the node version.


Can someone provide me right way to install latest nodejs.


Thanks

11.10 - Can't boot from USB after installing Ubuntu

I bought a Samsung series 5 notebook and a very strange thing happened: I installed Ubuntu 11.10 from a usb pen drive but when I restarted (...