LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (http://www.linuxquestions.org/questions/linux-general-1/)
-   -   How do I Reboot into Linux at night and back to WinXP in the morning? (http://www.linuxquestions.org/questions/linux-general-1/how-do-i-reboot-into-linux-at-night-and-back-to-winxp-in-the-morning-230179/)

kayhan 09-13-2004 04:49 PM

How do I Reboot into Linux at night and back to WinXP in the morning?
 
Hello,

I work in a university department. We have a computer lab whose main purpose is for undergraduate computer labs. Almost all of those labs must be run in Windows, so the computers have to have Windows of some sort on them. The researchers in the department would like to use these computers for some real work in Linux when they are not being used for labs. What we would like is for the computers to reboot from Windows into Linux at a certain time of night (say 19:00) and then reboot in the morning (say 07:00) back into Windows for the labs. We would also like the computer to check to make sure that no one is currently using the computer.

We can't be the first people to want to do something like this, but we can't find anything with google that willl help us.

What is the best way for us to do what we want?

Thanks,
kg

enigma82 09-13-2004 05:57 PM

I didn't try this but I think you might try using cron to set the reboot job at the desired time in Linux and Task Scheduler in Windows at the same time but I don't know how you can choose in GRUB/LILO on which OS you want to go.
I think that it can be done so that at reboot time in LInux you could modify the loader's config but from within windows that is pretty much impossible, so this turns into one big nothing.

jschiwal 09-13-2004 06:09 PM

If the default OS is windows, then a cron job could handle the linux -> windows reboot event, but I don't know how you could do both. Maybe dedicating one or two machines for linux would be a better idea. Perhaps using VNC or something similar so more than one user would run linux remotely might be another idea.

arno 09-13-2004 06:17 PM

If you are using grub its very easy.
Create two grub.conf files one with default boot windows and one with default boot linux
Use this tool to get access to the linux file system to copy the linux boot grub file
http://e2fsprogs.sourceforge.net/ext2.html
Use your favorite batch program to reboot your system

kayhan 09-14-2004 10:49 AM

Thanks for the replies, all. I would have replied earlier but I didn't get the email.

I forgot to post the most challenging part of this, um, challenge. Our distro is Mandrake 8.2 and our bootloader is Lilo 22.2.

I see where you are going with that, arno, but as you see, we are using Lilo. What we had done in the past was to set the default boot as Linux. Whenever there was a reboot, it would boot all the way up into Linux and then run a script that would check what time it was. If it was time to be in Windows, it would do that Lilo trick of rebooting once into another operating system. This is an ugly, but doable solution. What we really want, is something that checks to make sure no one is using the computer at reboot time. It happened before that someone was working on an Excel spreadsheet at 9pm and left to go to the bathroom. When he came back, the computer had rebooted and he lost a lot of changes. I realize that this is more of a Windows question now, but I was hoping someone had a whole solution.

jschiwal 09-16-2004 05:45 PM

I think it is possible to use the rdev command to change the lilo default entry, which could be windows. Either that, or changing the 'lilo.conf' default entry with sed and rerunning lilo before shutting down. However, being able to change the default from windows may not be possible.
This sounds more like a policy issue to me. I.E. when finishing after this shift, reboot into windows. You know, like putting down the toilet seat when you are done.


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