Tech Support > Operating Systems > Linux / Variants > Remote Rebooting To Other Operating Systems
Remote Rebooting To Other Operating Systems
Posted by rehm on February 16th, 2004


i came to a point of needing to work both in native xp and linux
environments remotely... i spent the weekend figuring a clean safe way
of doing this and thought it was cool so i'm posting it here. if you'd
like to try this out, be sure that you really know well about
bootloaders and stick with nothing else since i've had some problems
doing it incorrectly, but its pretty safe, here it is:
-> create an ntfs bootdisk and create two boot.ini's under (eg)
boot_xp.ini and boot_lin.ini

-> install lilo to a hd's mbr so that it only serves the purpose of
receiving a bootcall from the ntfsbootdisk and boot your linux(it only
boots linux automatically)

-> copy this 512byte lilo boot block into a small file using dd (
man dd - see more about using bs=512 count=1 ), and have this file on
where the ntbootdisk can access ( i don't know why a:\bootimg.bin
wouldn't work if anyone knows please let me know ) it-> eg: save this
lilo bootblock signature in c:\bootlin.img or anyname you want

-> create a script one on each machine, on xp and linux/ or
implement some routing to have one of your boot_*.ini files overwrite
boot.ini on the floppy. ( an alternative expert way is to sed/awk and
change the Default= line in the boot.ini file of your floppy ) (more
details about how to set the default have boot.ini edited to boot
linux can be google'd for on the net; essentially just a line of two
of text have to be edited which is among the differences between the
xp-default boot.ini and linux variant)

-> the idea was simple after no trials&error was successful with
lilo acting as the primary bootloader.

-> the idea to be safe proof about doing this is not to touch,
windows mbr bootstrap because i kept getting ntldr not found...i'm a
novice when it comes to understanding what was causing this with
windows, but minimzing to altering boot.ini is very safe...

note: that the dd and installing lilo anywhere are dangerous if you
are not experienced using these commands...someone with a little bit
of experience can help you with this

-> if all goes well, show it off to some people and see that you have
can have linux vs windows comparisons.

->shutting down:
you may be trying to see how come windows? well i'm forced to use
windows for sometime and have found the rdp protocol very suitable for
doing remote work right on my home machine..on the other hand i have
linux i can do remotely as well from any X machine...you can even find
some javaX projects so that both desktops can be done through a web
browser. two commands you may to look at are 'shutdown' in the windows
dos box and reboot for linux(after going su in an ssh session and
running a script/cmd to overwrite the boot.ini on floppy).. i
initially have a script on each os to overwrite the boot.ini on the
floppy for the default option to call the respective os, and then
issue a reboot command.

If there are other ways so i can avoid using microsoft's bootdisk
altogether, i'd like to hear from you guys..


rehm

Posted by joseph philip on February 17th, 2004


On Mon, 16 Feb 2004 15:29:45 -0800, rehm wrote:


Here's what I usually do, with LILO:


Set the default as linux.
To reboot from linux to nt, execute "lilo -R NT5 && /sbin/reboot"

To reboot from NT to linux, reboot. The default option's linux.

If you have three things there, it gets a bit interesting...






Posted by rehm on February 18th, 2004


"joseph philip" <joseph@nntp.will.suffice> wrote in message news:<pan.2004.02.17.06.53.25.496259@nntp.will.suf fice>...

My reply:
Thanks for replying to me.. Unfortunately i have had some mishaps in
attempting that, i kept getting ntloader missing errors, but thanks I
think i might try that on floppy again in the future, but I really
think it can conflict with the nt bootloader again..PLUS I am not
USING NT! I am using Windows XP Professional!! It can behave very
radically different between how these ntboot loaders residing on
nt's/xp partition can interact with lilo (i've tried 3 lilo version's,
including even the one most up-to date as of last saturday) ...
Another reason this may be useful is the idea of being insane, let's
say you don't want to reboot back into linux?..then you're doing an
extra reboot...so far this has been the easies configuration and
safest concerning XP + Linux remote rebooting, I never tried out NT5
or prior nt's however and I think W98 and W95 shouldn't cause problems
with lilo as it has with XP..If you're viewing this again joseph and
have gotten that scenario functioning with XP I'd be very delighted in
hearing from you that it worked for XP as well...I'm eager to hear
about it since I found it very dangerous to try lilo+XP booting up,
especially if you're changing the 'default' boot loader code for lilo
(according to my experience this has created havoc on three occasions
mentioned below) ..So as I like to place some discoveries on certain
flaws, i believe a few power users out there can take note of some
problems when it comes to more complex setups which may create real
havoc on your system ( like a damaged partition table -> this has
occured the 2 times i tried using only LILO for doing the rebooting,
last time i tried was a few weeks ago, last weekend i got this
bootdisk technique eased up with the ntloader flawlessly which i was
glad to initally post up about..it was a bit of pain of finding this
out )...
...in my case,
i'm also using three harddisks which this solution too works perfectly
i was asking if anyone has done this since i have tried this 2 times
before some weeks ago without more success than lilo+'a rewrite to its
bootloading code from xp'+'after an xp reboot' would always seemingly
mention ntlr cannot be found kind of message after rewriting the lilo
bootcode for a second time from linux--> rendering a corruption to the
ntfs bootloader residing on the ntfs bootsector where your xp
resides...that's why i'm not suggesting to use lilo for nothing else
than it to boot linux and never windowsxp (though I know and I have
been doing even lilo's latest version to boot up xp previously)..i
would only stick with nt's boot.ini(on disk which i'm using for this
method, i would admit its also safe to use it on the hdrive as well,
but in this particular setup i am not) for now to boot its xp and make
use of it to call lilo that's residing on a specified mbr of one of my
harddisks(the lilo+lilo daisychain creates a freeze for the 2nd lilo->
this setup attempt was due to the fact of ntdlr error message i was
trying to circumvent)..i have had 2 ntdr bootcoding
error-corruptions(my xp is always the first partition of the
harddisk), just previously and the last attempt just before, the lilo
reinstall is also not even supposed to touch the xp-home's ntfs
partition where the bootcode resides..i'm sure some people would like
to know about these things and I would also suggest to newbies to
always boot from a floppydisk for linux and stick with xp's bootdisk
for its os after seeing this type of strange ntdr loader not found
errors..eg: it may reboot fine into xp for two times consecutively,
but after logging into the linux os, then trying to go back into xp,
yes!, the ntdr loader would cry about not being able to boot up xp..so
if you're sure about an alternative solution, you can test to see
about how much flaw there is between using the two, it may have to do
nothing with bootloaders afterall, possible microjunk is doing some
kind of routine causing this havoc..who knows, but this was tricky,
and in the end i'd say pretty educational, i've learned a few tricks
about restoring my lost partition tables for my 40gb hd, only having
to manually restore a few dirty values here and there for the third
time, fun ..so that's why i posted about this very safe
mechanism!...also since i've noticed strange behaviours unmentioned
across multiple mount points on ext3fs, i should also mention that for
novices this is probably all just a bunch of fuss, but the bottom line
its free software and i'm hoping the bugs in advanced setups can be
spotted where the breakdown is, i know there are some power users here
so that's why i'm writing up to this list ..as for the possible
ntfs-bootloader corruption, i'm just suspecting that the
ntfsbootloader(which resides on the partition xp is) is, i should of
been more wise enough to do a comparison of before and after of a
possible change on it...but maybe a much later time, i got sick of
these ntldr not found errors...and if you've tried lilo+nt rebooting
it would probably not be the same as trying lilo+xp...because i'm
working with 3 harddisks and many partitions- it may be about this too
I have no clue but to the least lilo+xp may behave very differently (
just suspecting ).. thanks for the reply..


rehm


Similar Posts