[NX personal test and valid] Ubuntu, Jetson nano, NX board boot settings to start automatically, Jetson nano, NX set x11vnc to start automatically

! ! Ubuntu, Jetson nano, NX board boot settings to start at boot, nano NX settings x11vnc to start at boot! !

1. Create an rc-local self-starting service

2. Create a running script

3. Start the service

4.NX, nano set up x11vnc and set it to start automatically at boot

You're done! It’s not easy to write. If you succeed, please follow or like. Thank you~~


1. Create an rc-local self-starting service

1. First create a self-starting service at boot

sudo vim /lib/systemd/system/rc-local.service

2. Then copy the following code directly into it without any changes.

[Unit]
Description=/etc/rc.local Compatibility
Documentation=man:systemd-rc-local-generator(8)
ConditionFileIsExecutable=/etc/rc.local
After=network.target

[Service]
Type=forking
ExecStart=/etc/rc.local start
TimeoutSec=0
RemainAfterExit=yes
GuessMainPID=no

2. Create a running script

1. Create the /etc/rc.local script file and write the script program you want to run

sudo  vim /etc/rc.local

2. Then fill in the code you want to run: The following is an example, one is for the fan to start

Just put the command you want to run in front of exit 0 .

Personally, I think this method is more convenient than shipping .sh files! !

#!/bin/sh -e

#风扇自起
sudo sh -c 'echo 200 > /sys/devices/pwm-fan/target_pwm'

exit 0

3.Give permission

sudo chmod +x /etc/rc.local

3. Start the service

sudo systemctl enable rc-local
sudo systemctl start rc-local.service
sudo systemctl status rc-local.service

After running the above code, this display will appear. If it displays green, it means the startup is successful.

 Restart the computer and it will be OK!

sudo reboot

4.NX, nano set up x11vnc and set it to start automatically at boot

1. Install x11vnc

sudo apt-get install x11vnc -y

2.Set vnc startup password

sudo x11vnc -storepasswd /etc/x11vnc.pass
sudo chmod 777 /etc/x11vnc.pass

 3. Create startup instructions

 cd /etc/init 
 sudo vim x11vnc.conf

 Add the following directives without modification:

#start on runlevel [2345]
#stop on runlevel [06]
#script
    exec /usr/bin/x11vnc -auth guess -capslock -forever -loop -noxdamage -repeat -rfbauth /etc/x11vnc.pass -rfbport 5900 -shared
#end script

 4. Add auto-start at boot

(1) Find the following picture in the software:

(2) Open as follows: 

(3) Click Add on the right:

 

 Enter the second line: bash /etc/init.d/x11vnc.sh, then save

 ~~You can restart it now~~


I wrote it myself so it's a bit complicated, but at least it's done hehe. If you have any optimizations, please discuss in the comment area! !

You're done! It’s not easy to write. If you succeed, please follow or like. Thank you~~


Guess you like

Origin blog.csdn.net/Callme_TeacherPi/article/details/131314514