This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How configure tightvnc to run programs?
#1
After the vnc server is started, the program Windows are not displayed although the program process is running. Probably the problem is that they can't capture the display. How can fix it?

Presumably the code section to run vnc in tinker-config file:

Code:
get_vnc(){
 if [ -e /lib/systemd/system/tightvncserver.service ]; then
   if systemctl status tightvncserver.service | grep -q -E "enabled;"; then
     echo 0
   else
     echo 1
   fi
 else
   echo 1
 fi
}

set_vnc_passwd() {
 if [ ! -e /home/linaro/.vnc ]; then
   sudo -i -u linaro mkdir /home/linaro/.vnc
 fi
 if [ ! -e /home/linaro/.vnc/passwd ]; then
   sudo -i -u linaro touch /home/linaro/.vnc/passwd
   chmod 600 /home/linaro/.vnc/passwd
 fi
 sudo -i -u linaro vncpasswd -f <<< $1 > /home/linaro/.vnc/passwd
}

do_vnc() {
 DEFAULT=--defaultno
 if [ $(get_vnc) -eq 0 ]; then
   DEFAULT=
 fi
 if [ "$INTERACTIVE" = True ]; then
   whiptail --yesno "Would you like to automatically start the VNC server at boot?" $DEFAULT 20 60 2
   RET=$?
 else
   RET=$1
 fi
 if [ $RET -eq 0 ]; then
   if [ ! -d /usr/share/doc/tightvncserver ] ; then
     if [ "$INTERACTIVE" = True ]; then
       whiptail --msgbox "tightvncserver is not installed" 20 60 1
     fi
     return 1
   fi
   if [ "$INTERACTIVE" = True ]; then
     whiptail --msgbox "You will now be asked to enter a password for VNC server" 20 60 2
     sudo -i -u linaro vncpasswd
   fi
   if [ -e /lib/systemd/system/tightvncserver.service ]; then
     sudo systemctl stop tightvncserver.service
     sudo systemctl disable tightvncserver.service
     sudo rm /lib/systemd/system/tightvncserver.service
   fi
   cat > /lib/systemd/system/tightvncserver.service << EOF
[Unit]
Description=TightVNC Server
After=sshd.service network.target

[Service]
Type=forking
User=linaro
ExecStartPre=-/usr/bin/tightvncserver -kill :1 > /dev/null 2>&1
ExecStart=/usr/bin/tightvncserver :1
ExecStop=/usr/bin/tightvncserver -kill :1
[Install]
WantedBy=multi-user.target
EOF
   sudo systemctl daemon-reload
   sudo systemctl start tightvncserver.service
   sudo systemctl enable tightvncserver.service
   VNC_BOOT_STATUS=enabled
 elif [ $RET -eq 1 ]; then
   if [ -e /lib/systemd/system/tightvncserver.service ]; then
     sudo systemctl stop tightvncserver.service
     sudo systemctl disable tightvncserver.service
     sudo rm /lib/systemd/system/tightvncserver.service
     sudo systemctl daemon-reload
   fi
   VNC_BOOT_STATUS=disabled
 else
   return $RET
 fi
 if [ "$INTERACTIVE" = True ]; then
   whiptail --msgbox "Starting VNC server at boot is $VNC_BOOT_STATUS" 20 60 1
 fi
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)