Difference between revisions of "Building PXE-ready ReactOS"

From ReactOS Wiki
Jump to: navigation, search
(It works now!)
(The Windows way)
Line 78: Line 78:
  
 
Remember that both DHCP and TFTP servers should be running and there should not be another DHCP server in the same network.
 
Remember that both DHCP and TFTP servers should be running and there should not be another DHCP server in the same network.
 +
 +
Jedi-to-be has discovered that the TFTPD32-only setup works well too. See screenshots too.
 +
<gallery>
 +
File:Pxe1.png|PXE file system
 +
File:Pxe2.png|TFTP server ip configuration
 +
File:Pxe3.png|TFTPD32 general settings
 +
File:Pxe4.png|TFTP role configuration
 +
File:Pxe5.png|DHCP role configuration
 +
</gallery>
  
 
=== The QEMU way ===
 
=== The QEMU way ===

Revision as of 22:48, 30 December 2014

This sub-project has been suspended, because of poor support for PXE and UEFI.
You can use a Linux-Live-CD as replacement.
ReactOS PXE Project Team:

In revision r51517 in ReactOS was introduced support for PXE boot. It is now ({rev|65903}} possible to completly load the OS from a client computer. Freeldr needs to be compiled with gcc, the rest can be compiled either by gcc or msvc.

Preparing the LAN

For this scenario, we need two computers. One client (may be diskless or empty HDD) and one server (Windows, or better, Linux). Both have to be connected to the local network.

The server must run a DHCP-server and a TFTP-server. The client needs a PXE-ready network card. Most onboard network cards support it.

Preparing the server

You first need to install a TFTP server and a DHCP server on the remote computer. These steps will be only lightly covered here. Let's assume now that your TFTP server root is in /path/to/tftpboot, and that pxe boot filename is pxelinux.0

The Linux way

I used dhcp3 and tftpd-hpa. Use your favorite Linux and install them. I used Bind at home, but you can leave that out.

# Sample configuration file for ISC dhcpd for Debian
# $Id: dhcpd.conf,v 1.1.1.1 2002/05/21 00:07:44 peloy Exp $
ddns-update-style none;
# option definitions common to all supported networks...
option domain-name "home.local";
option domain-name-servers 10.0.0.254;
# If this DHCP server is the official DHCP server for the local
# network, the authoritative directive should be uncommented.
authoritative;
# Use this to send dhcp log messages to a different log file (you also
# have to hack syslog.conf to complete the redirection).
log-facility local7;
subnet 10.0.0.0 netmask 255.255.255.0
{
        range 10.0.0.10 10.0.0.19;
        option domain-name-servers myserver.home.local;
        option domain-name "home.local";
        option routers IPofYourServer;
        option broadcast-address 10.0.0.255;
        default-lease-time 28800; # 8 hrs
        max-lease-time 86400; # 1 day
        allow bootp;
        host myclient
        {
                hardware ethernet 00:0F:EA:66:07:48;
                fixed-address myclient.home.local;
                filename "pxelinux.0";
                server-name "myserver.home.local";
        }
}

Check if present, xinetd/inetd config for tftpd.

service tftp
{
        disable         = no
        log_type        = SYSLOG daemon info
        log_on_access   = PID HOST USERID EXIT DURATION
        socket_type     = dgram
        protocol        = udp
        wait            = yes
        user            = root
        server          = /usr/sbin/in.tftpd
        server_args     = -vv -s /path/to/tftpboot/
        bind            = IPofYourServer
}

The Windows way

On the Windows server, a combination of the free tools TFTPD32 (you'll only need the DHCP server!) and the SolarWinds TFTP server (because the built-in server of TFTPD32 does not work well with its DHCPD) has been proven working.

Remember that both DHCP and TFTP servers should be running and there should not be another DHCP server in the same network.

Jedi-to-be has discovered that the TFTPD32-only setup works well too. See screenshots too.

The QEMU way

You need to add "-net nic -net user,bootfile=pxelinux.0,tftp=/path/to/tftpboot" to your usual QEMU command line.

The VirtualBox way

Note that to have it working, you have to use NAT network configuration for your VM, and only one of the PCnet network cards. Otherwise, it won't work.

You need to move your TFTP root directory into your personnal VBox directory using the name TFTP. For instance, in Linux, it would be in ~/.VirtualBox/TFTP

You then need to rename the pxelinux.0 file to VMName.pxe where VMName is the name of your VM in VBox. Then, in this TFTP directory, proceed as with any other TFTP configuration described upper.

For instance, if your VM is named "ROSPXE", your ~/.VirtualBox/TFTP will contain:

chain.c32  freeldr.ini  freeldr.sys  pxelinux.cfg/default  ReactOS-LiveCD.iso  ROSPXE.pxe

Creating contents on TFTP server

You need to download some ReactOS ISO file, for example here

Put the ISO file in /path/to/tftpboot with the name ReactOS-LiveCD.iso

Extract loader/setupldr.sys to /path/to/tftpboot, and rename it to freeldr.sys

You need to download SysLinux 4.05, or a more recent version, for example here

Extract core/pxelinux.0 and com32/modules/chain.c32 to /path/to/tftpboot

Create /path/to/tftpboot/pxelinux.cfg directory and put in it a file named default (no extension) with the following contents:

DEFAULT chain.c32
APPEND file=freeldr.sys seg=0x0F80 keeppxe

Create /path/to/tftpboot/freeldr.ini with the following contents:

[FREELOADER]
DefaultOS=LiveCD_Debug
TimeOut=3
[Display]
TitleText=ReactOS LiveCD
StatusBarColor=Cyan
StatusBarTextColor=Black
BackdropTextColor=White
BackdropColor=Blue
BackdropFillStyle=Medium
TitleBoxTextColor=White
TitleBoxColor=Red
MessageBoxTextColor=White
MessageBoxColor=Blue
MenuTextColor=Gray
MenuColor=Black
TextColor=Gray
SelectedTextColor=Black
SelectedColor=Gray
ShowTime=No
MenuBox=No
CenterMenu=No
MinimalUI=Yes
TimeText=Seconds until highlighted choice will be started automatically:
[Operating Systems]
LiveCD="LiveCD"
LiveCD_Debug="LiveCD (Debug)"
LiveCD_Screen="LiveCD (Screen)"
[LiveCD]
BootType=Windows2003
SystemPath=ramdisk(0)\reactos
Options=/MININT /RDPATH=net(0)\ReactOS-LiveCD.iso /RDEXPORTASCD
[LiveCD_Debug]
BootType=Windows2003
SystemPath=ramdisk(0)\reactos
Options=/DEBUG /DEBUGPORT=COM1 /BAUDRATE=115200 /SOS /MININT /RDPATH=net(0)\ReactOS-LiveCD.iso /RDEXPORTASCD
[LiveCD_Screen]
BootType=Windows2003
SystemPath=ramdisk(0)\reactos
Options=/DEBUG /DEBUGPORT=SCREEN /SOS /MININT /RDPATH=net(0)\ReactOS-LiveCD.iso /RDEXPORTASCD

Booting

Try to boot your client computer via PXE. After some seconds, a ramdisk is loaded and ReactOS starts.