PDA

View Full Version : Running X before chroot...



Sago7
05-07-2004, 09:32 PM
I have a cuestion...

When i make chroot from console whout X... If i try wiht STARX can i see the X of the remastering knoppix????...

arkaine23
05-17-2004, 06:34 PM
That is how I remaster.

Boot in text mode with code knoppix 2
chroot into your remaster filesystem
(from outside of chroot) cp /etc/X11/XF86Config-4 /mnt/hdxx/your/remaster's/etc/X11
cp -R /etc/skel /home/knoppix
chown -R knoppix /home/knoppix
vi /home/knoppix/.xinitrc (and set tyhe WM I want to start)
su knoppix
startx

Then you are in the graphical environment of your remaster. When finished tweaking, you'll need to replace /etc/skel with /home/knoppix, and chown to root the new /etc/skel. Some other complications can arise in KDE with both the menu and kicker. One thing I've noticed with KDE 3.2 is that you need .local copied from /etc/skel along with other parts of a user's profile through the /etc/X11/Xsession.d/45xsession script. Otherwise kicker icons may be broken.

When done, don't forget to delete the XF86Config-4 file and resolv.conf files you copied, and don't foget to move all of /home/knoppix over the original /etc/skel. Be wathcful for programs' configuration directories in /home/knoppix that are not set to be copied from /etc/skel into /home/knoppix by the /etc/X11/Xsession.d/45Xsession script. Also, don't forget to chroot -R root /etc/skel.

For example, if you install firebird in your remaster, there is a /home/knoppix/.firebird directory which will go into /etc/skel when you are done. However, you must make sure it gets copied from /etc/skel into /home/knoppix at boot time along with other configurations in the script /etc/X11/Xsession.d/45Xsession, or else your remaster will use the default firebird configuration.

mzilikazi
05-18-2004, 01:23 PM
One thing I've noticed with KDE 3.2 is that you need .local copied from /etc/skel along with other parts of a user's profile through the /etc/X11/Xsession.d/45xsession script. Otherwise kicker icons may be broken.

I had the same issue when dealing w/ an xfce4 remaster. I needed some .files so I added this to /etc/init.d/Xsession.d/45xsession

cp -R /etc/skel/.file $HOME
chown -R knoppix:knoppix $HOME/.file

How did you circumvent this problem? I have yet to test this w/ persistent home but it may be problematic.

arkaine23
05-21-2004, 04:21 PM
I added the .folders from /etc/skel that I thought I'd need into the 45xsession script's list of .folders copied.

techfreak
05-26-2004, 04:39 AM
Hi i'm trying to change the look of my custom Knopper but I cant knop into X windows environment under chrooted.
I did everything like stated above and I got an error when starting x

(EE) unable to locate/open config file
(EE) Error from xf86HandleConfigFile()

Fatal server error:
no screens found

any ideas?

techfreak
05-26-2004, 06:14 AM
Figured it out, just copied XF86Config-4 file that was generated by the knoppix boot cd to the chrooted /etc/X11 folder and worked fine.

nvgringo
05-26-2004, 10:28 PM
looks like the same problem that I am having.
Can you give the command you used to copy over the XF86Config-4file
Also can you go step by step on how to save the settings so that I will be able to burn a live cd that will have my modified KDE settings but will not have saved hardware settings specific to my computer

techfreak
05-26-2004, 11:22 PM
Once you boot up with the cd Knoppix automatically generates an XF86Config-4 file which is stored in ram in this location /etc/X11. so all you have to do is copy that file to your chrooted environment in the same location. My chrooted enfironment is stored in "/mnt/hda2/aWORKing/"

So here is the command I used to copy the file and than run startx in chrooted environment.

cp /etc/X11/XF86Config-4 /mnt/hda2/aWORKing/etc/X11

Once you're in chrooted X windows environment anything you modify is on the fly and is saved automatically. Once you logout you have to copy the /home/knoppix to /etc/skel and chown it to root. This is how your settings get saved, at least that's how i understand it.
Once you are don delete the XF86Config-4 file from your chrooted environment that you copied to get X Windows up and running and also delete /home/knoppix once you are done.

nvgringo
05-27-2004, 02:55 AM
Ok, let me see if I have it now.

cheatcode knoppix 2
mount /dev/hda3 /mnt/hda3
cp /etc/X11/XF86Config-4 /mnt/hda3/ knx/source/KNOPPIX /etc/X11
chroot /mnt/hda3/knx/source/KNOPPIX
mount –t proc /proc proc
cp -R /etc/skel /home/knoppix
chown -R knoppix /home/knoppix
vi /home/knoppix/.xinitrc
i
startkde
ESC
ZZ
? add the .folders from /etc/skel to 45xsession? a little help here
su knoppix
startx

Assuming KDE starts lets say I make the toolbar smaller and change the bookmarks in Konq.

ok now I want to save my work.

?cp -R /home/knoppix /etc/skel?
?chown -R /etc/skel?
? rm -i /etc/X11/XF86Config-4?
? rm -i /home/knoppix?
umount /proc
CTRL D

I think I am getting closer but I don't quite have it yet. Can you help with a few of the commands where I put the question marks?
Thanks for your time

arkaine23
05-27-2004, 03:10 PM
The 45xsession script does a lot of things. What you should be concerned about is a couple of lines that copy .files from /etc/skel to /home/knoppix. These will not be too hard to find in the script. You'll just add additional configurations such as .local to the list, including the config directories for any programs you may have installed and adjusted their configuration.

You could do the shotgun approach and add .* to the lists, which would copy all directories or files from /etc/skel that start with a ".".


?cp -R /home/knoppix /etc/skel?

Rather than copy /home/knoppix over /etc/skel. I usually move the original /etc/skel outside of my remastered filesystem (from a non-chrooted terminal)

mv /your/remaster's/etc/skel /skel.bak

Then in the chrooted environment-
mv /home/knoppix /etc/skel


?chown -R /etc/skel?

chown -R root /etc/skel
(We want /etc/skel to be owned by root, but had to make it owned by knoppix earlier when we worked in X and altered configurations.)

? rm -i /etc/X11/XF86Config-4?

rm -f /etc/X11/XF86Config-4


? rm -i /home/knoppix?

This was handled earlier when moving the original /etc/skel somewhere safe and replacing it with the modified /home/knoppix.

Don't forget to umount /proc and also replace /etc/resolv.conf with the original resolv.conf file if you chose to get online using your remastered filesystem. The remastering guide covers some minor cleanup of temporary files (apt-get clean is an important one to conserve space if you installed anything with apt!!). And the rtest is building it and then testing it.

It took me hundreds of hours to make my first remastered Knoppix. I learned a lot by making mistakes and by asking questions here.

nvgringo
05-27-2004, 06:46 PM
Thank you all very much. I'm sure I will have a lot more questions. I am creating a live DVD. I think I will call it Bloat. I added back Gnome and Xfce4 and anything else I could that didn't remove files or update libs. So far everything works great. I just need to adjust a few thing in the desktops

nvgringo
05-30-2004, 02:56 AM
I got KDE up and running. The KDE setup program started. I changed a few of the settings and burned the iso. The settings did not save. I must have missed something. I will try again in a couple of days and post all of the steps.

nvgringo
06-02-2004, 02:14 AM
I got KDE to start. I got the default startup. You know where it asks for your country and style settings. most of the programs are in the menu but all of the settings in KDE are default. It looks like the command cp -R /etc/skel /home/knoppix does not copy over the hidden files with the settings. Also none of my drives mounted. Am I supposed to run 45xsession script so that the .files copy to /home/knoppix? or is that someting that starts when KDE starts? Is there some command that will copy the hidden files?

I tried to start synaptic from KDE. It wanted Root password. would it be ok to set a root password to get software installed or would that create problems?

nvgringo
06-03-2004, 03:30 AM
I managed to copy the files from /etc/skel to /home/knoppix using drag and drop in konq. the settings seemed right but everything was in german and the mouse did not work and none of the drives loaded. this is driving me nuts

arkaine23
06-03-2004, 04:53 PM
You do not have an /etc/fstab file in your remaster's filesystem because hardware detection has not been run, so you won't be able to mount drives very easily. It's better if you use a terminal that is not chrooted in order to copy files into your remastered filesystem. Some things are easier to do outside the chroot and some must be done inside it.

cp /mnt/hda#/some/file /mnt/hda#/my/remastered/filesystem



to copy the .files if they are getting missed-

cp -R /etc/skel/.* /home/knoppix



you can

ls -al /home/knoppix

to see all files in that directory (including the hidden files)




This is why when I'm done with editing the configurations in X, I move the original /etc/skel somewhere else and then rename /home/knoppix to /etc/skel. That way I know everything is there in /etc/skel, and that /home/knoppix no longer exists. Then I chown it back to root.

mv /my/remaster's/etc/skel /mnt/hda#/skel.bak (done outside chroot)

mv /home/knoppix /etc/skel (done inside chroot)

chown -R root /etc/skel (done inside chroot)



And the last trick is the 45xsession script. This script controls just which configurations in /etc/skel will get put in /home/knoppix when you actually boot off your remastered CD. So if a configuration for some program or some part of KDE is not listed in the lines of the script that do this, then the remastered CD will not use those configurations.



It's not too hard, but it has taken me weeks sometimes to sort it out and get it working right.

nvgringo
06-06-2004, 05:35 PM
It worked, it looks like all of my settings were saved. One minor problem now. At least I think that it is minor. The only window manager that will work is KDE. I used your "shotgun approach" for the 45-xsession. Maybe here is a file in /etc/skel that I need user knoppix to own so that the window manager selection will be written and saved

arkaine23
06-08-2004, 02:33 PM
Ah, yes. For icewm and fluxbox, the global configs are in /usr/share I think. I haven't tried adjusting wmaker or xfce yet. I figure that a few barebones minimal window managers are a good thing.

When you are in those WM's as knoppix in your chrooted environment, you are adjusting the user-level configs in /home/knoppix that eventually get put in /etc/skel. However these WM's are set to use the global configs instead of the uyser configs. So to make changes to them, I suggest comparing your already modified configs with the ones in /usr/share/icewm and /usr/share/fluxbox.

Icepref, myice, and several other gui configurators are available for icewm if you don't want to edit the configuration by hand. You'll just need to install one of them with apt-get (and possibly remove it later if you are running low on space). I usually edit fluxbox configs by hand.

Also, if you want to set bmp/jpg/png backgrounds in fluxbox instead of the tiles that its themes use, you can edit the theme files. To accomplish this I install eterm (a transperancy-capable terminal) which includes the program esetroot. Esetroot can be used in the fluxbox theme configurations to set an image as a background. This is not the only way to set a background in a fluxbox theme, but its the way I like to do it.

I didn't know anything about tweaking icewm or fluxbox until I started remastering my own Knoppix. Google and various Linux forums were able to answer all my questions though.

I also had some trouble with getting Gnome to restore its saved session, but I can't remember now what I did to make it work......

nvgringo
06-08-2004, 05:40 PM
First of all thanks again for taking your time to help.
But I dont think that you understand the problem that I am having. It does not matter which desktop I try to use KDE is the only one that will come up. If I choose fluxbox as a cheat code at startup KDE starts. If I use Fabians restart X script and choose GNOME. X restarts with KDE. I could understand If the WM started up without the changed settings. but they are not starting at all. Just KDE. The settings in KDE saved just fine by the way.
Also if I want to use Synaptic in the chroot enviroment with X running do I have to set up a root password? If I do have to set up a root can I remove it before burning the remaster?
Have I used up all of my questions yet :wink:

Sago7
06-08-2004, 11:29 PM
Before chroot-.... Startx X with:

startx /usr/bin/fluxbox

That is????...

Or edit the file... i dont remember his name... but when you see it you will say: "this is".. because the name is very explicit, its in /etc/ or /etc/X11/. And inside of the file is the default window manager... Just change KDE for Fluxbox..

pokemontel
06-09-2004, 05:07 AM
Hi..
After following all the step given by all member,
I managed to came out with my remastered cd.

The only problem is that, when I', using startx under the chroot env, follow the given step by

arkaine23
----------------------------------
That is how I remaster.

Boot in text mode with code knoppix 2
chroot into your remaster filesystem
(from outside of chroot) cp /etc/X11/XF86Config-4 /mnt/hdxx/your/remaster's/etc/X11
cp -R /etc/skel /home/knoppix
chown -R knoppix /home/knoppix
vi /home/knoppix/.xinitrc (and set tyhe WM I want to start)
su knoppix
startx

--------------------------------

The problem is that its say that I can't run kde . not enough memory...
FYI, I'm using 2GB of memory. I had check using top on the parents directory and still got lots of available memory.

Need input....

thank you

pokemontel...

arkaine23
06-11-2004, 03:11 PM
When you chrooted, did you also mount proc?

arkaine23
06-11-2004, 03:17 PM
First of all thanks again for taking your time to help.
But I dont think that you understand the problem that I am having. It does not matter which desktop I try to use KDE is the only one that will come up. If I choose fluxbox as a cheat code at startup KDE starts. If I use Fabians restart X script and choose GNOME. X restarts with KDE. I could understand If the WM started up without the changed settings. but they are not starting at all. Just KDE. The settings in KDE saved just fine by the way.
Also if I want to use Synaptic in the chroot enviroment with X running do I have to set up a root password? If I do have to set up a root can I remove it before burning the remaster?
Have I used up all of my questions yet :wink:

That's pretty strange. I have never had that soprt of problem with the desktop cheatcodes. Perhaps it's you lingering .xinitrc file in /etc/skel. You could remove it without causing any problems.

I hesitate to mess with the root account since I managed to break being able to su without a password just by trying to adjust some things in the KDE control center. So in my remaster, you always have to "sudo su" instead of just "su". Passwords are in /etc/passwd. You could blank out the root password when you're done and it should go back to the way it was. Is using apt-get from the command-line that much of a hassle?

CrashedAgain
06-12-2004, 04:38 AM
First of all thanks again for taking your time to help.
But I dont think that you understand the problem that I am having. It does not matter which desktop I try to use KDE is the only one that will come up. If I choose fluxbox as a cheat code at startup KDE starts. If I use Fabians restart X script and choose GNOME. X restarts with KDE. I could understand If the WM started up without the changed settings. but they are not starting at all. Just KDE. The settings in KDE saved just fine by the way.
Also if I want to use Synaptic in the chroot enviroment with X running do I have to set up a root password? If I do have to set up a root can I remove it before burning the remaster?
Have I used up all of my questions yet :wink:

What KDE are you using? If it's 3.2, perhaps this is the cause of the problem. This will affect settings in kdm which is probably the default login mgr.
http://bugs.kde.org/show_bug.cgi?id=75882
A couple of other checks you could try to see if the other wm's are working OK:
1) Try 'startxfce' or starxfce4' from a KDE Konsole. Usually xfce will start within KDE.
2) try 'xdm' from terminal login. This will start xdm instead of kdm as the login manager. Xdm is the default login manager for xfce and should not be affected by the above 'bug'.



The problem is that its say that I can't run kde . not enough memory...
FYI, I'm using 2GB of memory. I had check using top on the parents directory and still got lots of available memory.


I have had this happen also. It seems to occur when 45xsession script is unable to sucessfully open any window manager. Possibly it is using up all available memory trying to start kde which then shows as a low memory situation, it doesn't actually mean you need more memory but instead something is wrong with your start kde setup. The memory check is at the very end of the 45xsession script.
I was not successful trying to get x to start in chrooted environment, I've given up & am having more success remastering starting from a Knoppix-style HD install.

CrashedAgain
06-13-2004, 03:35 PM
The problem is that its say that I can't run kde . not enough memory...
FYI, I'm using 2GB of memory. I had check using top on the parents directory and still got lots of available memory.


I have had this happen also. It seems to occur when 45xsession script is unable to sucessfully open any window manager. Possibly it is using up all available memory trying to start kde which then shows as a low memory situation, it doesn't actually mean you need more memory but instead something is wrong with your start kde setup. The memory check is at the very end of the 45xsession script.
I was not successful trying to get x to start in chrooted environment, I've given up & am having more success remastering starting from a Knoppix-style HD install.

I have just had this error occur again, the cause was that /home/knoppix got deleted, then when KDE tried to start it couldn't find the settings to start dcopserver. It thrashed around for a bit & eventually ended up giving the 'not enough memory' error & dumping me into TWM. So, another thing to check is the .hidden files in your /home/user directory.

pokemontel
06-14-2004, 08:22 AM
thank arkaine23....

yup after I mount the proc under chroot env using

#mount -t proc /proc proc

my problem solved.
will update soon...

nvgringo
06-14-2004, 12:44 PM
I tried to restore skel.bak but sill only KDE worked. I am going to start all over again. I'll let you know how it works out. This thread has a great deal of useful information. thanks and respect to all!

nvgringo
06-19-2004, 04:00 AM
I followed the steps but in my remaster all of the .files are in /mnt/hda3/knx/source/KNOPPIX/home/root. I do not recall creating the /root subdirectory. Was this created when I Chown root? Is this correct? I have not tried to burn the iso yet.

arkaine23
06-22-2004, 04:12 PM
/home/root always exists. I wouldn't mess with it.

If you "startx" before doing "su knoppix" you will be adjusting the files in /home/root instead of the ones in /home/knoppix.


Its all a matter of preference really. I leave the root configs as they are, and create my own knoppix user configs to adjust (and use those to replace the skeleton configs- /etc/skel). I'm also cautious about adjusting anything for fear of having to start completely over and always make a backup copy of the original files.


It's a lot of stuff to keep track of and easy to make small mistakes. But eventaully you come to understand what each config is for and how it all inter-relates.