last day (15 days later) » 

4:29 PM
1
A: How to change autologin from root to non-root user?

林果皞You told me in other comment that your system shows this: $ systemctl get-default graphical.target So, change it to multi-user.target: $ sudo systemctl set-default multi-user.target And multi-user.target will start at tty1 (Ctrl+Alt+F1): $ systemctl list-dependencies multi-user.target | gr...

 
Thank you very much 林果皞 But when I want to ` cat ~/home/m/.xinitrc` it says: cat: /root/home/m/.xinitrc: No such file or directory and when I want to ` cat ~/.config/openbox/autostart ` it says cat: /root/.config/openbox/autostart: No such file or directory
 
@user145959 create that files if not exist. The answer above, I assume you logged in as m (non-root) user when perform the tasks. /root/home/m/ is incorrect since ~ is your current user. This is my typo to replace your username, I will update my answer.
@user145959 You shouldn't logged-in as root user when create that files, otherwise the files owner will become root instead of home user.
 
I tried with m user but got same result
 
@user145959 I assume your username is m , what's the output when run echo ~ ?
 
Should I do everything from the first with m user again?
echo ~ says /home/m
 
4:29 PM
@user145959 I assume your non-root user is m, since you don't mentioned the real non-root username in your question.
@user145959 Then do vi ~/.xinitrc to write the content.
 
Yes I have 2 user. one is root and other is m. But m user has not sudo access: m is not in the sudoers file. This incident will be reported.
 
@user145959 su -> type your root password -> adduser m sudo (ref: unix.stackexchange.com/a/179961/64403). Don't forget exit current bash session from root to perform your task.
 
I built it for /home/m/.xinitrc but for /home/m/.config/openbox/autostart it says : ".config/openbox/autostart" E212: Can't open file for writing when I want to save it
Can I put in inside /etc/xdg/openbox/autostart instead of /home/m/.config/openbox/autostart
 
@user145959 better don't, since you want your gui session run as non-root. What's the output of ls -la /home/m/.config/openbox OR ls -la /home/m/.config ? Isn't that folders exist ? Can you cd /home/m/.config/openbox ?
@user145959 You should run vi /home/m/.config/openbox/autostart, not vi .config/openbox/autostart. What command do you run to edit your file ?
 
ls -la /home/m/.config/openbox ls: cannot access '/home/m/.config/openbox': No such file or directory
ls -la /home/m/.config total 12 drwx------ 3 m m 4096 Nov 19 16:18 . drwxr-xr-x 8 m m 4096 Nov 23 14:59 .. drwx------ 2 m m 4096 Nov 19 16:18 pulse
 
4:29 PM
@user145959 mkdir /home/m/.config; cp -R /etc/xdg/openbox /home/m/.config/ , read this
 
It didn't work :(
I have only a blank screen
 
@user145959 That's the purpose of the /tmp/log_file, is that files exist after reboot ? Also you can direct test by login with m in other vt (i.e Ctrl+Alt+F[1|2|3|4|5...], I wonder you know this before), and /home/m/.profile will be executed if loggedin. Change 1 in ` "$XDG_VTNR" -eq 1` to your tty number to test without reboot. Did systemctl get-default changed to multi-user.target ? Also don't forget to revert back what you've done before follow my instruction. (e.g. the rc.local and systemd file you've edited). I have no problem to pop up the img in Ubuntu 17.04. (not server version)
 
How to check /tmp/log_file is exist or not? Ctrl+Alt+F[1|2|3|4|5...] don't work! I think keyboard don't work at all(I use SSH). How can I find my tty number? when I ran systemctl list-dependencies multi-user.target | grep getty I got same result as what you put and I think my tty number is 1 too. and about last question, yes, it is changed to multi-user.target
I found a difference, this is my content: # /etc/systemd/system/getty@tty1.service.d/10-noclear.conf [Service] TTYVTDisallocate=no# /etc/systemd/system/getty@tty1.service.d/override.conf [Service] ExecStart= ExecStart=-/sbin/agetty --autologin m %I $TERM
sorry, I really wasted your time a lot
 
You see I do > /tmp/hole1, > /tmp/test1, > /tmp/yy, right ? Check that files created or not by listing the files in directory /tmp/, i.e. ls -la /tmp/
 
total 24
drwxrwxrwt 7 root root 240 Nov 23 16:32 .
drwxr-xr-x 22 root root 4096 Nov 23 15:48 ..
drwxrwxrwt 2 root root 40 Nov 23 15:49 .ICE-unix
drwxrwxrwt 2 root root 40 Nov 23 15:49 .Test-unix
drwxrwxrwt 2 root root 40 Nov 23 16:32 .X11-unix
drwxrwxrwt 2 root root 40 Nov 23 15:49 .XIM-unix
drwxrwxrwt 2 root root 40 Nov 23 15:49 .font-unix
-rw-rw-r-- 1 m m 1 Nov 23 16:32 hole1
-rw-rw-r-- 1 m m 1 Nov 23 16:32 hole2
-rw-rw-r-- 1 m m 5 Nov 23 16:32 hole3
ls /tmp/
hole1 hole2 hole3 hole4 serverauth.1uveyhEfZg
 
4:37 PM
cat /home/m/.xinitrc ?
 
cat /home/m/.xinitrc
#!/usr/bin/env bash
echo 55 > /tmp/test1
exec openbox-session
echo 55 > /tmp/test2
cat /home/m/.config/openbox/autostart
#
# These things are run when an Openbox X Session is started.
# You may place a similar script in $HOME/.config/openbox/autostart
# to run user-specific things.
#

# If you want to use GNOME config tools...
#
#if test -x /usr/lib/arm-linux-gnueabihf/gnome-settings-daemon >/dev/null; then
# /usr/lib/arm-linux-gnueabihf/gnome-settings-daemon &
#elif which gnome-settings-daemon >/dev/null 2>&1; then
# gnome-settings-daemon &
#fi

# If you want to use XFCE config tools...
 
Also, is /usr/bin/env bash working ? (Ctrl+D after run without error)
/usr/bin/env bash
 
May you explain more?
i did copy /usr/bin/env bash but had no result
 
run /usr/bin/env bash
is there any error ?
 
no nothing happens
 
4:40 PM
ok, just Ctrl+D to exit after run.
 
ok i did it
and wrote exit
 
that's means exec startx -- -nocursor has problem, since it doesn't run ~/.xinitrc
$ type -a startx
startx is /usr/bin/startx
startx is /usr/bin/startx

$ cat /usr/bin/startxtype
is your startx file same as this pastebin.com/8fQEuAt2 ?
 
Did you read this part of my question?

Then I tried to create ~/.xinitrc file with this content:

#!/usr/bin/env bash
/home/m/img &
exec openbox-session

Then made it executable by this command: chmod +x ~/.xinitrc

But I got nothing(even it didn't show my openbox after reboot), So I executed this command too:

ln -s ~/.xinitrc ~/.xsession
Maybe i damaged it before by doing that?
-a startx
-bash: -a: command not found
 
you can do unlink ~/.xsession , in my ubuntu, I'm not even has ~/.xsession symlink.
 
cat /usr/bin/startxtype
cat: /usr/bin/startxtype: No such file or directory
I don't know how to unlink it! unfortunately I only do what other user suggest :(
 
4:50 PM
sorry, my typo, I means cat <you result from type >
e.g. type -a startx return me the path /usr/bin/startx, then you need to do cat /usr/bin/startx
unlink ~/.xsession
unlink is a command.
 
unlink: cannot unlink '/home/m/.xsession': No such file or directory
when I type " startx -a " it says "-bash: -a: command not found
"
 
I believe it's /root/.xsession since you are loggein as root previously.
what's your output of "type -a startx" ?
 
-bash: -a: command not found
sorry
 
"type" is a command.
 
startx is /usr/bin/startx
-bash: type: -a: not found
 
4:55 PM
"cat /usr/bin/startx" ?
compare with the pastebin.com/8fQEuAt2
 
#!/bin/sh

#
# This is just a sample implementation of a slightly less primitive
# interface than xinit. It looks for user .xinitrc and .xserverrc
# files, then system xinitrc and xserverrc files, else lets xinit choose
# its default. The system xinitrc should probably do things like check
# for .Xresources files and merge them in, start up a window manager,
# and pop a clock and several xterms.
#
# Site administrators are STRONGLY urged to write nicer versions.
#

unset DBUS_SESSION_BUS_ADDRESS
 
Can you do this way:
"sudo vimx /etc/default/grub"

edit the "quiet splash" to "text"

then do "sudo update-grub"
vimx is vi in your system.
then edit to remove the "#!/usr/bin/env bash " in /home/m/.xinitrc.
 
when I run sudo vimx /etc/default/grub
it opens an empty file
 
And edit the "exec startx -- -nocursor" to "startx" in ~/.profile
 
sudo vi /etc/default/grub
opens an empty file
 
5:04 PM
sudo cp /usr/share/grub/default/grub /etc/default/
 
cp: cannot stat '/usr/share/grub/default/grub': No such file or directory
 
never mind, forget about it.
 
I use Ubuntu server and only installed openbox
then edit to remove the "#!/usr/bin/env bash " in /home/m/.xinitrc. ....I did it
 
The reason I want you to edit is because it will shows log indicated it's still running instead of splash screen when boot up, So you will not think it hang.
edit the "exec startx -- -nocursor" to "startx" in ~/.profile, done ? reboot it to see.
wait, one more thing
nvm, just reboot after edit startx
 
only blank screen
 
5:15 PM
"ls -la /tmp/" still same ? No/tmp/test1 ?
"ls -la /tmp/" still same ? No file /tmp/test1 ?
 
total 20
drwxrwxrwt 7 root root 220 Nov 23 17:15 .
drwxr-xr-x 22 root root 4096 Nov 23 15:48 ..
drwxrwxrwt 2 root root 40 Nov 23 17:12 .ICE-unix
drwxrwxrwt 2 root root 40 Nov 23 17:12 .Test-unix
drwxrwxrwt 2 root root 40 Nov 23 17:12 .X11-unix
drwxrwxrwt 2 root root 40 Nov 23 17:12 .XIM-unix
drwxrwxrwt 2 root root 40 Nov 23 17:12 .font-unix
-rw-rw-r-- 1 m m 1 Nov 23 17:12 hole1
-rw-rw-r-- 1 m m 1 Nov 23 17:12 hole2
-rw-rw-r-- 1 m m 5 Nov 23 17:12 hole3
m@nanopim1:/tmp$ ls
hole1 hole2 hole3 hole4
there is no test1 file inside /temp folder
I use a spi LCD, and I launched it to work by this two .conf files

Add to file /etc/modules-load.d/fbtft.conf

spi-bcm2835

fbtft_device

and


Add to file /etc/modprobe.d/fbtft.conf

options fbtft_device custom name=fb_ili9341 gpios=reset:1,dc:201,led:6 speed=16000000 rotate=90 bgr=1
Maybe problem relates to this?
 
change startx to "startx > /tmp/my.log 2>&1"
then reboot again to see the log.
cat /tmp/my.log after reboot.
 
X.Org X Server 1.18.4
Release Date: 2016-07-19
X Protocol Version 11, Revision 0
Build Operating System: Linux 4.4.0-97-generic armv7l Ubuntu
Current Operating System: Linux nanopim1 3.4.113-sun8i #16 SMP PREEMPT Tue Jun 13 14:15:57 CEST 2017 armv7l
Kernel command line: root=UUID=10b3b795-f372-4ea9-b78a-93ae9355c20c rootwait rootfstype=ext4 console=tty1 console=ttyS0,115200 hdmi.audio=EDID:0 disp.screen0_output_mode=1920x1080p60 panic=10 consoleblank=0 loglevel=1 ubootpart=bd75a2d6-01 ubootsource=mmc sunxi_ve_mem_reserve=0 sunxi_g2d_mem_reserve=0 sunxi_fb_mem_reserve=16 cgroup_enable=memo
cat /home/m/.local/share/xorg/Xorg.0.log
[ 23.363]
X.Org X Server 1.18.4
Release Date: 2016-07-19
[ 23.363] X Protocol Version 11, Revision 0
[ 23.363] Build Operating System: Linux 4.4.0-97-generic armv7l Ubuntu
[ 23.363] Current Operating System: Linux nanopim1 3.4.113-sun8i #16 SMP PREEMPT Tue Jun 13 14:15:57 CEST 2017 armv7l
[ 23.363] Kernel command line: root=UUID=10b3b795-f372-4ea9-b78a-93ae9355c20c rootwait rootfstype=ext4 console=tty1 console=ttyS0,115200 hdmi.audio=EDID:0 disp.screen0_output_mode=1920x1080p60 panic=10 consoleblank=0 loglevel=1 ubootpart=bd75a2d6-01 u
 
try this: "sudo apt-get purge nvidia-"
sudo apt-get purge nvidia-*
* asterisk at the end
 
5:31 PM
E: Unable to locate package nvidia
ok removed it
 
also try "Xorg -configure"
 
X.Org X Server 1.18.4
Release Date: 2016-07-19
X Protocol Version 11, Revision 0
Build Operating System: Linux 4.4.0-97-generic armv7l Ubuntu
Current Operating System: Linux nanopim1 3.4.113-sun8i #16 SMP PREEMPT Tue Jun 13 14:15:57 CEST 2017 armv7l
Kernel command line: root=UUID=10b3b795-f372-4ea9-b78a-93ae9355c20c rootwait rootfstype=ext4 console=tty1 console=ttyS0,115200 hdmi.audio=EDID:0 disp.screen0_output_mode=1920x1080p60 panic=10 consoleblank=0 loglevel=1 ubootpart=bd75a2d6-01 ubootsource=mmc sunxi_ve_mem_reserve=0 sunxi_g2d_mem_reserve=0 sunxi_fb_mem_reserve=16 cgroup_enable=memo
I think the problem is finding my SPI LCD
I tried to make run my LCD by creating these files:

Add to file /etc/modules-load.d/fbtft.conf

spi-bcm2835

fbtft_device

and


Add to file /etc/modprobe.d/fbtft.conf

options fbtft_device custom name=fb_ili9341 gpios=reset:1,dc:201,led:6 speed=16000000 rotate=90 bgr=1
it uses fbtft framebuffer kernel support to work
 
5:52 PM
Change your startx to "FRAMEBUFFER=/dev/fb1 startx > /tmp/my.log 2>&1"
Also, ls -la /usr/share/X11/xorg.conf.d/
 
total 40
drwxr-xr-x 2 root root 4096 Oct 31 16:00 .
drwxr-xr-x 5 root root 4096 Oct 31 15:08 ..
-rw-r--r-- 1 root root 1099 Mar 3 2016 10-evdev.conf
-rw-r--r-- 1 root root 1350 Oct 13 14:10 10-quirks.conf
-rw-r--r-- 1 root root 590 Mar 3 2016 11-evdev-quirks.conf
-rw-r--r-- 1 root root 364 Mar 3 2016 11-evdev-trackpoint.conf
-rw-r--r-- 1 root root 1751 Mar 3 2016 50-synaptics.conf
-rw-r--r-- 1 root root 1385 Mar 3 2016 50-wacom.conf
-rw-r--r-- 1 root root 590 Mar 3 2016 51-synaptics-quirks.conf
 
Also "cat /home/m/.local/share/xorg/Xorg.0.log"
 
should I reboot and do it after reboot?
 
is ok, just do it after reboot
you changed to FRAMEBUFFE=/dev/fb1 already ?
 
yes
but I think I should change to fb8
cause my LCD works only with fb8
cat /home/m/.local/share/xorg/Xorg.0.log
[ 24.216]
X.Org X Server 1.18.4
Release Date: 2016-07-19
[ 24.216] X Protocol Version 11, Revision 0
[ 24.216] Build Operating System: Linux 4.4.0-97-generic armv7l Ubuntu
[ 24.216] Current Operating System: Linux nanopim1 3.4.113-sun8i #16 SMP PREEMPT Tue Jun 13 14:15:57 CEST 2017 armv7l
[ 24.216] Kernel command line: root=UUID=10b3b795-f372-4ea9-b78a-93ae9355c20c rootwait rootfstype=ext4 console=tty1 console=ttyS0,115200 hdmi.audio=EDID:0 disp.screen0_output_mode=1920x1080p60 panic=10 consoleblank=0 loglevel=1 ubootpart=bd75a2d6-01 u
 
6:01 PM
then try fb8 also
And "cat /etc/X11/Xwrapper.config"
 
changing to fb8 had no result
again blank screen
cat /etc/X11/Xwrapper.config
cat: /etc/X11/Xwrapper.config: No such file or directory
 
cat /home/m/.local/share/xorg/Xorg.0.log ?
 
cat /home/m/.local/share/xorg/Xorg.0.log
[ 25.284]
X.Org X Server 1.18.4
Release Date: 2016-07-19
[ 25.285] X Protocol Version 11, Revision 0
[ 25.285] Build Operating System: Linux 4.4.0-97-generic armv7l Ubuntu
[ 25.285] Current Operating System: Linux nanopim1 3.4.113-sun8i #16 SMP PREEMPT Tue Jun 13 14:15:57 CEST 2017 armv7l
[ 25.285] Kernel command line: root=UUID=10b3b795-f372-4ea9-b78a-93ae9355c20c rootwait rootfstype=ext4 console=tty1 console=ttyS0,115200 hdmi.audio=EDID:0 disp.screen0_output_mode=1920x1080p60 panic=10 consoleblank=0 loglevel=1 ubootpart=bd75a2d6-01 u
It starts openbox very easy when I put "startx" inside "/etc/rc.local"
but I don't know why it can't recognize my lcd now
 
6:25 PM
What you put in rc.local ? "cat /etc/rc.local" ?
 
nothing
exit 0
I say when I put startx , it can find my LCD
but now it can't
it was strange for me why now it gives [ 25.411] (EE) No devices detected.
 
if you put it back and do "sudo systemctl set-default graphical.target" , you can see your screen again.
 
Why now I can't?
I mean why with multi-user it doesn't work
 
did you tried put startx back to rc.local and reboot ?
 
no
i will do it now
 
6:31 PM
and don't change back to "graphical.target" now to test.
 
ok
it works...it shows the openbox gray screen with mouse pointer
I didn't change to graphical.target and only put startx inside rc.local and it worked
 
what's the output of "ls -la /dev/fb*" ?
 
crw-rw---- 1 root video 29, 0 Nov 23 18:31 /dev/fb0
crw-rw---- 1 root video 29, 1 Nov 23 18:31 /dev/fb1
crw-rw---- 1 root video 29, 2 Nov 23 18:31 /dev/fb2
crw-rw---- 1 root video 29, 3 Nov 23 18:31 /dev/fb3
crw-rw---- 1 root video 29, 4 Nov 23 18:31 /dev/fb4
crw-rw---- 1 root video 29, 5 Nov 23 18:31 /dev/fb5
crw-rw---- 1 root video 29, 6 Nov 23 18:31 /dev/fb6
crw-rw---- 1 root video 29, 7 Nov 23 18:31 /dev/fb7
crw-rw---- 1 root video 29, 8 Nov 23 18:31 /dev/fb8
But I know this command only works by fb8 (I tested it before)

Add to file /etc/modprobe.d/fbtft.conf

options fbtft_device custom name=fb_ili9341 gpios=reset:1,dc:201,led:6 speed=16000000 rotate=90 bgr=1
 
how did you test to know it only works by fb8 ?
 
Sorry, I meant this command:

FRAMEBUFFER=/dev/fb8 startx
 
6:38 PM
you put it in rc.local ?
 
no before I make .conf files I tested them manually
fb8 only could run my LCD
 
it mostlikely is because of permission issue, since ~/.profile run startx as non-root user , but /etc/rc.local run starts as root.
since your log also shows "(EE) open /dev/fb8: Permission denied "
 
So should I make a .conf file?
where should I build that? with what name?
what content?
unfortunately it says:

man Xorg.wrap
man: can't set the locale; make sure $LC_* and $LANG are correct
No manual entry for Xorg.wrap
 
6:58 PM
sudo usermod -a -G audio m
sudo usermod -a -G video m
add m user to video group.
then remove the startx at rc.local, and retry
reboot
If still failed after reboot, try dpkg-reconfigure xserver-xorg-legacy and /etc/X11/Xwrapper.config steps mentioned at the thread.
if still failed, `cat /home/m/.local/share/xorg/Xorg.0.log` to see error fb8 permission denied message still there or not.
if not there, post the new log here.
If still there, you may better ask a question with that info OR try to install Ubuntu Desktop 17.
 
worked!!!!!!!!!!!!!!1
adding m to audio and video groups worked
Thamk youuuuuuuuuuu
but your answer had many steps...may you final edit it? and I can use your answer for future
again thank you.....I don't know how to say
if I could I gave you 100+ points
 
7:31 PM
I'm glad I was able to help, cheers :)
 

last day (15 days later) »