LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 12-31-2002, 10:20 PM   #1
MasterC
LQ Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu ; CentOS ; Raspbian
Posts: 12,613

Rep: Reputation: 69
Reboot or chroot?


Besides the obvious, a need for the kernel built for that distro, is there any other decent reason to reboot to switch distros on the same box?

Ok, I run basically the same kernel in all my distros, with the exception of the kernel in Mandy which is the default kernel.

So with the exception of Mandy...

Will I run into a lot of problems if I just chroot into my other distro's (Slack and LFS) root environment and run things from there as if I had booted into it? I really can't think of any, but am not sure if I'd be missing services, or if it'd run into problems when probing modules or what...

Thanks for any ideas, thoughts or slams

Cool
 
Old 01-01-2003, 12:05 AM   #2
rootboy
Member
 
Registered: Oct 2001
Distribution: Mint 15
Posts: 770

Rep: Reputation: 51
You're talking about leaving one root and using another, including loading a new kernel?

I suppose that you could leave the remnants of the old kernel in memory, but how are you going to trigger the loading of the new kernel (and init)?


Or do I have this all wrong?


John
 
Old 01-01-2003, 05:10 AM   #3
MasterC
LQ Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu ; CentOS ; Raspbian
Posts: 12,613

Original Poster
Rep: Reputation: 69


No, I am not nearly that good. I will be lucky to chroot

No, no kernel switching, and that's why I am wondering if I will have problems chrooting, even though the kernel that is loaded from the intitial root env, is basically identical to the new chrooted env.



Cool
 
Old 01-01-2003, 01:03 PM   #4
rootboy
Member
 
Registered: Oct 2001
Distribution: Mint 15
Posts: 770

Rep: Reputation: 51
Quote:
Originally posted by MasterC


No, I am not nearly that good. I will be lucky to chroot
And here I was impressed as all get out. No earthly idea as to why you would do this, but impressed as hell


Quote:
No, no kernel switching, and that's why I am wondering if I will have problems chrooting, even though the kernel that is loaded from the intitial root env, is basically identical to the new chrooted env.



Cool
Sounds like a great way of breaking things, but you could always reboot

But if your kernels are the same, then I would think that it would be fairly transparent. It should work...

Why would you want to do this?


John
 
Old 01-01-2003, 04:04 PM   #5
UnTamed
Member
 
Registered: Dec 2002
Location: Qc, Canada
Distribution: CRUX
Posts: 317

Rep: Reputation: 30
More than the same kernel, the way they are config'd is more important, iianm.

May sound like "a great way of breaking things" but it's been a great way of fixing things for me.

I can't say I tried a whole lot of different things in chroot mode but I've compiled a few things, including kernels, and have no problems chrooting to different kernel version, including 2.5.xx.

If the kernel works, once loaded, it'll run whatever / you assign it, provided it could run it in native mode.
i.e. don't chroot into a xfs if the kernel doesn't support it or that kinda thing ...but you probably figured that much already.
 
Old 01-01-2003, 11:55 PM   #6
MasterC
LQ Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu ; CentOS ; Raspbian
Posts: 12,613

Original Poster
Rep: Reputation: 69
Cool, thanks guys.

Quote:
Why would you want to do this?
Pretty stupid really, but here's why:

I wish I had a better reason, and might someday, but for now... I ssh into my box from work. Sometimes I want to work in my other distro as I have other things setup on it for different use, such as multimedia editing, Office file manipulation, CD ripping, etc. So to work in 1 distro or the other, from work, instead of rebooting, I was hoping to just be able to chroot into the other distro's / directory and basically "reboot" without rebooting. So yeah, the kernels are very close to the same, with small differences that I think won't matter to me in my ssh'd chrooted env.

I will be giving it a go later on tonight and post back with the success rate.

Thanks again both you!

Cool
 
Old 01-02-2003, 05:02 AM   #7
rootboy
Member
 
Registered: Oct 2001
Distribution: Mint 15
Posts: 770

Rep: Reputation: 51
Sounds like fun, keep me posted


John
 
Old 01-02-2003, 05:25 AM   #8
MasterC
LQ Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu ; CentOS ; Raspbian
Posts: 12,613

Original Poster
Rep: Reputation: 69
It worked wonderfully. Not even a complaint that "couldn't stat blah blah from /lib/modules/" or anything.

Thanks!

Cool
 
Old 01-02-2003, 06:03 AM   #9
rootboy
Member
 
Registered: Oct 2001
Distribution: Mint 15
Posts: 770

Rep: Reputation: 51
Quote:
Originally posted by MasterC
It worked wonderfully. Not even a complaint that "couldn't stat blah blah from /lib/modules/" or anything.

Thanks!

Cool
Neat, I'm going to have to play with that.

And I especially like the "I ssh into my box from work" part.

Quake via telnet?


John
 
Old 01-02-2003, 06:12 AM   #10
MasterC
LQ Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu ; CentOS ; Raspbian
Posts: 12,613

Original Poster
Rep: Reputation: 69
ha ha ha ha,

I am still trying to figure out how to "startx" and have it popup on my desktop here at work, yet be from my box at home so I can work as if I were home.

Doing all this from cygwin on win2k, so it's not too easy. I do have wmaker installed though, and that's pretty cool cause I can feel like I am on linux

Cool
 
Old 01-02-2003, 06:26 AM   #11
MasterC
LQ Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu ; CentOS ; Raspbian
Posts: 12,613

Original Poster
Rep: Reputation: 69
In fact, I'll post this here, and then head over to the screenshot thread and post it there, it's win2k running cygwin, running wmaker:
ftp://masterc.no-ip.org/pics/screenshots/cygwmaker.jpg



Cool
 
Old 01-03-2003, 06:48 AM   #12
rootboy
Member
 
Registered: Oct 2001
Distribution: Mint 15
Posts: 770

Rep: Reputation: 51
Quote:
Originally posted by MasterC
ha ha ha ha,

I am still trying to figure out how to "startx" and have it popup on my desktop here at work, yet be from my box at home so I can work as if I were home.

Doing all this from cygwin on win2k, so it's not too easy. I do have wmaker installed though, and that's pretty cool cause I can feel like I am on linux

Cool
I've done it with my old Agenda PDA, which was cool. I don't know about doing it with cygwin though...


John
 
Old 01-03-2003, 09:18 AM   #13
SlickWilly
Member
 
Registered: Dec 2002
Posts: 327

Rep: Reputation: 30
Quote:
Originally posted by MasterC

I am still trying to figure out how to "startx" and have it popup on my desktop here at work, yet be from my box at home so I can work as if I were home.
xhost +
vi /etc/ssh/ssh_config

Host *
ForwardX11 yes
:wq

Remove any iptables rule blocking X.

ssh mybox
startx &

wait... wait... wait...


note: This is *way* insecure. Read up on xhost and set it for your work machine('s gateway). Leaving it in the condition I've described above will open you up to any vunerabilities in X, in addition to letting people suck your bandwidth by loading up the X logon and attempting brute attacks on it.

[edit]
Running X over a Wide area network (the internet) is a desperately bad thing to do... X is a 'chatty' protocol and will do things like send the position of your remote desktop's mouse cursor to your home machine, even if the mouse hasn't moved. It's slow... *very* slow. Nasty nasty protocol.. great for local machines, horrible for remote machines.

Consider running vncserver instead :P
[/edit]

Slick.

Last edited by SlickWilly; 01-03-2003 at 09:20 AM.
 
Old 01-03-2003, 09:52 AM   #14
MasterC
LQ Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu ; CentOS ; Raspbian
Posts: 12,613

Original Poster
Rep: Reputation: 69
Thanks Slick I've ran vncserver before, the problem I ran into was it opens up twm instead of *my* desktop. I was cool with the speed, not horribly bad (although it was definitely not even close to the speed of localhost), but just not the desktop I wish to be using.

I think I'll just stick with ssh'ing for now, the main thing I was thinking about using remote X for was to watch a movie or something from home, but that wouldn't work (too slow). The 2k at work doesn't allow installation of anything, so alot of videos won't play because they cannot download/install codecs. The rest of what I do via ssh from my work is done in the command line anyway.

Thanks again for that up there, it's just another thing to impress the winLusers at work with

Cool
 
Old 01-03-2003, 11:49 AM   #15
moses
Senior Member
 
Registered: Sep 2002
Location: Arizona, US, Earth
Distribution: Slackware, (Non-Linux: Solaris 7,8,9; OSX; BeOS)
Posts: 1,152

Rep: Reputation: 50
SSH allows a secure tunnel of the X protocol via the SSL. This
makes running X across the network no less secure than running
ssh. If your client and server are set up correctly, you don't have
to use xhost at all.
I can ssh in to work, type "xv &" as my first command and have
xv pop up on my home machine. No problems, not insecure (well,
compared with ssh anyway).

(I suppose I should also point out the lines necessary in your
client/server setup for a unix machine. . .)

for client:
/etc/ssh(2)/ssh_config:
Code:
ForwardAgent yes
ForwardX11 yes
(man ssh_config)

for server:
/etc/ssh(2)/sshd_config
Code:
X11Forwarding yes
X11DisplayOffset 10
X11UseLocalhost yes
N.B. The "X11DisplayOffset 10" changes your DISPLAY
variable to be offset (duh) from the default by 10 (in this case).
This prevents interference with real X servers. . .
(man sshd_config)

Last edited by moses; 01-03-2003 at 11:55 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
sudo /usr/bin/chroot /home/chroot /bin/su - xxx| /bin/su: user xxx does not exist saavik Linux - General 3 07-04-2007 10:30 AM
No keyboard/mouse after reboot. Requires second reboot to work. rottie Linux - Hardware 6 01-16-2006 05:04 AM
reboot when "reboot" command not responding? neocookie Linux - General 1 08-30-2005 04:59 AM
to chroot or not to chroot complus Linux - Security 4 02-29-2004 04:07 PM
chRoot SpaceCadet Linux - Networking 3 08-14-2003 05:29 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 01:35 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration