Can't startx as normal user. I don't know what I did wrong.
Linux From ScratchThis Forum is for the discussion of LFS.
LFS is a project that provides you with the steps necessary to build your own custom Linux system.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Can't startx as normal user. I don't know what I did wrong.
I tried Linux from scratch for the first time and I do everything according to the instruction provide by the website. Thenn I tried to get to the desktop.
I installed all packages in chapter 24 in BLFS 11.2 book and also most of their recommended dependencies when in chroot, and other than texlive, I downloaded all package tarballs in /sources/BLFS and installed from that, they're all configure, make, and test with root user as it's impossible for normal user to generate any of those command in that folder due to permision denied. After that, I restart and tried to startx with normal user. It looks like it's working but it's immediately terminated even before entering the desktop without any error. Startx working normally when I use root account or sudo, though. I don't know what's going wrong.
One thing I think of it is I followed the note in instruction from xinit page that's;
chmod u+s $XORG_PREFIX/libexec/Xorg
I don't know whether it is the cause of this and I don't know how to fix it back.
So, how can I fix this issue, or I have doing it wrong in the first place when I compiled everything from /sources folder with root user and I have to do everything all over again?
Last edited by KarnRedsun; 10-21-2022 at 04:19 PM.
Distribution: Void, Linux From Scratch, Slackware64
Posts: 3,155
Rep:
generally you should not untar archives as root as it can lead to odd permissions of extracted files, you would usually then install as root building as root shouldnt be a problem.
if you cant extract into your sources folder as a normal user you can just chown it eg
generally you should not untar archives as root as it can lead to odd permissions of extracted files, you would usually then install as root building as root shouldnt be a problem.
if you cant extract into your sources folder as a normal user you can just chown it eg
If you can start X as root then you probably dont have your normal user in the right groups, how are you starting the "desktop"?, which desktop?
By "Desktop" in this case I mean just the default UI for startx, in other words, TWM, I haven't install any desktop environment yet. So startx in this case is a mean to enter the desktop. As I said, when I startx, it seems like it's just about to enter the graphical session but then the X terminated before any windows in desktop session showed up. There's no error output. I checked out Xorg.0.log after it's terminated and compared it with the same log file after I entered X session in root and exited from that, there's no noticeable different at all. Everything look as if there's nothing wrong.
I have my normal user already in wheel, video, and audio groups so I don't think my user is not in the right group except if Linux From Scratch behave in different way than normal distributions. But if this problem is really a permission problem then where else I have to change ownership at this point without having to recompile every X related packages?
You didn't follow the blfs directions for building X.
1) Blfs pkgs are not built in a chroot except for a few to get going like bash shell scripts pcre wget openssh. You reboot and ssh in to do the Xorg deps and security pkgs like pam.
2) X requires logind so care must be taken to get it's circular deps right like dbus elogind/systemd. My regular user is in wheel group. No others. reboot after those then do X up to xorg-server, stop. Rebuild elogind/sysd so that logind has those X pkgs like book says. Reboot and finish X then test with startx. X is built as reg user and uses as_root script per book.
3) When doing blfs its best to get the above help BEFORE you start blfs from irc channel #lfs-support on libera to try and avoid the issues you are now having. Always state what init system and book you used here and on irc.
You can try and repair what you did (paste your xorg.0.log as reg user in this thread which you should have know to do. We need evidence not your view of what you did) but thats not fun and it annoys me and other support peeps to fix a build done wrong. So I'd start over and get the guidance i'm suggesting immediately after booting your fresh LFS.
Distribution: Void, Linux From Scratch, Slackware64
Posts: 3,155
Rep:
other than switching to the 'real' system to check boot up and x is working and a few odd packages i build a complete desktop in chroot itmakes no diference and can be easier to correct minor problems
You didn't follow the blfs directions for building X.
1) Blfs pkgs are not built in a chroot except for a few to get going like bash shell scripts pcre wget openssh. You reboot and ssh in to do the Xorg deps and security pkgs like pam.
2) X requires logind so care must be taken to get it's circular deps right like dbus elogind/systemd. My regular user is in wheel group. No others. reboot after those then do X up to xorg-server, stop. Rebuild elogind/sysd so that logind has those X pkgs like book says. Reboot and finish X then test with startx. X is built as reg user and uses as_root script per book.
3) When doin blfs its best to get the above help BEFORE you start blfs from irc channel #lfs-support on libera to try and avoid the issues you are now having. Always state what int system and book you used here and on irc.
You can try and repair what you did (paste your xorg.0.log as reg user in this thread which you should have know to do. We need evidence not your view of what you did) but thats not fun and it annoys me and other support peeps to fix a build done wrong. So I'd start over and get the guidance i'm suggesting immediately after booting your fresh LFS.
Archetech
Thank you, I appreciated your advice. However, let me clear up something first.
1) On how BLFS packages should not be build in chroot but have to build on actual system, if that's the case then there's no way I can fix but start over again because the entire process is already gone wrong since the first few hours of this whole ordeal. I have to start over. I know those packages should not build in chroot but when I rebuild many of those package dependencies over and over again I'm very tired of typing commands every single character and check that it wrote in exact same way as what stated in the instruction and it's already used up more than 3 days and I almost didn't get any sleep so I can't brute force it anymore and resorted to go back to chroot to ease up the stress on my arms and eyes and hoped that nothing gone wrong. I didn't SSH the machine because I did tried that with other PC with other distribution before and it can't connect and I still don't know whether it's because I didn't get that machine IP address right or it because I connected the network wrong as both PC at the time are just connected via LAN to the same modem router and there's no further configuration (I let them auto configure network). I don't know in the first place whether both machine are physically possible to SSH into each other when they both are connect to network in that simple way.
2) I already recompiled elogind and dbus multiple time to ensure that they are both working right with each other after I installed their other recommend dependencies and before installing the Xorg Server. From what you have said that means at least in your case rebuilding elogind and dbus again with normal user after X installed and rebuild X again with normal user solved the problem in your case. (elogind and dbus are listed as Xorg-server dependencies in the instruction but not the other way around so I think I don't have to recompile them again after xorg-server install) For now, I think I should try this first but still, the issue in 1) is likely the source of this problem for me as well.
3)Thank you, I will remember that. But, where's "irc channel #lfs-support on libera" that you've said? Do you means this forum here? Or that's the official support of the Linux from scratch project? Or it is not a place or website at all but the OS I tried to install itself?
4) I recorded the content of both Xorg.0.log with video but from what you have stated it seems this is beyond the point to post those now.
So, I will considered this issue solved for now as I already got some guidelines here. I will tried those again when I have more free time in later date.
Thank you for all advices and I apologize for posting this question.
Quote:
Originally Posted by Keith Hedger
other than switching to the 'real' system to check boot up and x is working and a few odd packages i build a complete desktop in chroot itmakes no diference and can be easier to correct minor problems
If that the case then that's mean how I build and install X packages in chroot is not really wrong in itself?
Last edited by KarnRedsun; 10-22-2022 at 08:18 AM.
Distribution: Void, Linux From Scratch, Slackware64
Posts: 3,155
Rep:
building in chroot is fine but some packages need to be configured in the real system , mysql for instance.
it is a good idea to boot to the real system to check all is ok, i usually do it after the initial sysytem is built after xorg and then after the desktop is installed.
Keith is experienced LFS builder like myself. We can get away with taking shortcuts chroot building etc that a new builder can't. I've seen what noobs do and they do what you did. You treated the build like a race to get things running like a kid with a new toy. That's a common mistake along with hand typing vs cp/paste configs. I mention Libera but you get all frazzled instead of just googling how to set up an irc client with libera. When you decided to do blfs you entered a much bigger challenge than LFS. Dependency order, environment variables properly set and not missing critical deps are very important. Slow down dont give up chat while you build on irc and have fun with it. Read the whys of things written and how the pkgs fit together to produce a machine with lots of moving parts. Or...go in circles of frustration. Blfs is not for linux novices either. Compiling vs using a distro pkg manager like apt/pacman are two very different skill levels on Linux.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.