Linux Mint Forums
Welcome to the Linux Mint forums!
How To Install over PXE+NFS
How To Install over PXE+NFS
Post by kossta » Sun Mar 04, 2012 10:37 am
REMINDER: ALWAYS BACKUP any configuration file you are about to change.
After 8 hours of searching and I think more than 30 PXE boot attempts, finally, LInux Mint can be installed over PXE
Setup Configuration:
DHCP/TFTP server: running in VMware Fusion virtual machine on MacOSX Lion
- Centos 6.2 (Final)
Kernel: 2.6.32-220.2.1.el6.i686
Gnome: 2.28.2
Webmin: version 1.580
Installation Media (in my case):
- Linux Mint 12 «Lisa» — CD no codecs (32-bit) — Download only and no need to be burned to CD
«linuxmint-12-gnome-cd-nocodecs-32bit.iso»
IP/DHCP
- -MacOS takes IP from Linksys router
-Centos VM ethernet set to take its IP from the Linksys router
-Centso DHCP server set to give IPs to targets from the same subnet
—Centos IP: 10.10.1.106 from DHCP of Linksys
—Centos DHCP server provides IP: 10.10.1.200 and above to the network boot PXE clients
—Centos DHCP and Linksys DHCP are running simultaneously, no problem
Remember to turn off Centos DHCP server when you do not need it any more.
Assuming you already have DHCP/TFTP server setup, it will take you about 10-15 minutes to be up and running Mint from network boot.
Here are only with the actual PXE configuration steps that you will need to load Mint 12 over PXE.
All below operations are done on your DHCP/TFTP server
- a) replace 10.10.1.106 with the IP of you DHCP server;
b) /tftpboot/ is my tftp server boot folder;
TFTP Config: /tftpboot/pxelinux.cfg/default
6: Start DHCP server, via Webmin
7: Turn target system «ON» (laptop/desktop) and select «Network boot» from boot options menu
When your laptop/desktop boots from PXE, you will/should see one PXE menu option:
- LinuxMint Livecd 12
When selected it will boot Linux Mint 12 LiveCD from «/tftpboot/images/linuxmint» directly to the graphical environment.
Select «Install» from the desktop to install Mint to the HDD.
I hope this helps, and safe you one day in Googling around how to boot LinuxMint12 from PXE/Network.
—
Re: How To Install over PXE+NFS
Post by Oscar799 » Sun Mar 04, 2012 6:06 pm
Как настроить с нуля PXE-установку Linux?
Ничего сложного, только описывать долго, постараюсь кратко с примерами.
В конфиг DHCP добавляем настройку типа:
Ключевое это строки с передачей IP для сервера TFTP и имя файла загрузчика.
Делаем каталог для будущих образов
Устанавливаем tftp-hpa (легко найти для любой системы)
В конфиге ставим флаги:
«-p -s /usr/tftpboot -B 1024 —ipv4»
Разархивируем
tar tar xjf syslinux-4.04.tar.bz2 -C /tmp
копируем в /usr/tftpboot/ следующие файлы:
Так же если планируем использовать кириллицу в меню скачаем шрифты, например эти
ftp://ftp.itrc.hp.com/applications/experteventadmi.
Кодировка меню должна быть в CP866 он же Russian(DOS)
сконвертировать из koi8-r (тандартная кирилическая для фри) можно командой.
iconv -f koi8-r -t CP866 defaultKoi8 -o default
создаем папку с образами
mkdir images
В ней подпапки с нужными системами, в каждую подпапку кидаем нужные для загрузки систем файлы, вот пару примеров:
Далее правим фаил конфига загрузчика:
/usr/tftpboot/pxelinux.cfg/default (Ну или с привязкой к конкретным сервакам, тогда не default)
Вот пример, пути править на свои:
Для загрузки windows нужно использовать специально собранный образ WinPE, который будет монтировать нужные образы с сетевой шары, но описание сборки вменяемого образа займет еще страниц 5 и мне лень уже печатать.
step by step to PXE boot Linux Mint over NFS
Here below a step by step to PXE boot Linux Mint over NFS
1/Prepare the Linux Mint files
open mint.iso in winrar (or any other iso reading capable tool).
extract casper folder to x:\pxe\iso\mint (or any path that suit you)
2/Prepare NFS Server
launch winnfsd with the following :
winnfsd.exe -id 0 0 x:\pxe\iso\mint
note : adapt the above path with your own path
3/Prepare iPXE Script
#!ipxe
set nfs-server $
kernel /ISO/mint/casper/vmlinuz root=/dev/nfs boot=casper netboot=nfs nfsroot=$
initrd /ISO/mint/casper/initrd.lz
boot
note : adapt /x/pxe/ISO/mint to your own path.
name it mint.ipxe and put it in x:\pxe
4/Prepare PXE Server
put ipxe-undionly.kpxe in x:\pxe
launch tiny pxe server with the following settings (leave other settings untouched) :
->boot filename = ipxe-undionly.kpxe (use the browse files and folders « … » button)
->filename if user-class=iPXE = mint.ipxe
push the online button
5/Boot !
pxe boot your computer and here we go 🙂
11 Responses to “step by step to PXE boot Linux Mint over NFS”
Thanks for the is great guide.
I’m having trouble getting this to work.
I put everything in c:\pxe
Path to mint is c:\pxe\iso\mint . Extracted casper, etc.
My mint.ipxe file looks like this:
#ipxe
set nfs-server $
kernel /ISO/mint/casper/vmlinuz root=/dev/nfs boot=casper netboot=nfs nfsroot=$
initrd /ISO/mint/casper/initrd.lz
boot
I’m sure the configuration is incorrect above. PXEbooting from a computer will attempt to work.. it gets to tftp://ipaddress/mint.ipxe…. ok then freezes.
Here’s the last part of the log:
7:48:35 PM TFTPd:DoReadFile:mint.ipxe B:1432 T:211
7:48:35 PM TFTPd:DoReadFile:mint.ipxe B:1432 T:211
7:48:39 PM TFTPd:TFTPException:Timeout
I’m running host on Windows 8.1 over gigabit ethernet. Thanks for any help.
Thanks for your feedback.
First : I would advise to disable your firewall on your windows host.
Second : replace $
Last : have you launched your nfs daemon? if so , please copy paste your command line.
Hi! This actually happened to me too, watch out when you copy the mint.ipxe file, I don’t know how this happend but it copied #ipxe instead of #!ipxe, and i see it happened to you too, just add the missing « ! ».
Thanks for the feedback.
Wrong ipxe header is a common error.
Hi! This was of great help to me! But I had the same problem as Rob, connection timeout. I guess this was due to bad configuration and folder structure. I want to clear that up for following readers.
First, here’s the ipxe file content I used:
#!ipxe
set nfs-server 192.168.0.100
kernel /ISO/mint/casper/vmlinuz root=/dev/nfs boot=casper netboot=nfs nfsroot=$
initrd /ISO/mint/casper/initrd.lz
boot
(next server was indeed causing connection timeout like mentioned above)
The iso was in E:\pxe\ISO\mint\ But the guide was a bit unclear. At first I copied only the content of casper into this folder! The ipxe file suggested otherwise, which was part of the solution. In fact I copied the whole iso’s contents (linux mint 16 32 bit xfce) into the folder, I don’t know if that made a difference.
The last important bit was formatting the ipxe file properly, watch out for those automatic newlines! It has to be exactly like Erwan posted it.
Thanks for your feedback, will definitely help others !
I like to boot into linux mint, in such a way that i don’t need a hdd inside my pc. I have a self build NAS and i try to start my linux from the nas so I can remove by HDD. Is this what your tutorial is about? Or is it that you install linux mint from your NAS to a local hhd inside your pc? That’s not realy clear to me. Also i use xpenology (same as synology) nas which has a XPE server build in. Can I use these script in the same way?
Thanks in advance
This is to boot a live distro.
But you could also also your linux to a remote network storage (over nfs or iscsi).
iscsi has my preference : you would only then need to pass the iscsi path thru your dhcp server or thru your ipxe script.
The system config file loads for me fine, I have a menu. I have tried to setup PXE Booting for Ubuntu, Debian and Mint. So far all that works is Ubuntu. If I select the Debian or Mint options and press enter, nothing happens.
does anyone know why this is?
Share your ipxe script.
Share you winnfsd command line.
Describe your folder setup.
first of all,
thanks for that amzing work you did -> this is frcking awesome
i only have problems with the installation
sometimes the installation crashes or it says everything wored out but after a quick restart the bios cant find any system on the HDD
is there a way to fix this or is this even made for the installation?
Pxe boot linux mint
Каждому, кто хоть изредка промышляет администрированием хотя бы раз нужно было установить операционку на комп. И зачастую происходит всё так: скачивается образ, записывается на диск или флешку, грузимся и ставим. Но может оказаться что ни флешки ни диска под рукой нет, а установку нужно выполнить на вчера. Тогда можно загрузится по сети, и с линуксом в этом плане особо проблем нет. Типичная конфигурация — это связка DHCP, TFTP и NFS. Но у меня под рукой не было настроенного NFS, зато была Samba. Поэтому пришлось разобраться как использовать Samba вместо NFS.
Вроде бы ничего такого, поменял настройки и всё, но что-то не работало поначалу, пришлось шаманить.
Но я тут начну с самого начала. Итак для начала нужно обзавестись дистрибутивом. Так как ставим мы Linux Mint, ищем свежий образ здесь. Скачиваем дистрибутив, подходящий именно нам (я ставил тот, что с MATE, но очевидно это не имеет особого значения). Скачав образ, нужно получить доступ к файлам образа. В некоторых руководствах рекомендуют распаковать образ, но я не вижу в этом смыла, поэтому поддерживаю мнение, которое заключается в том, чтобы смонтировать образ как loop. Чтобы не вмешиваться в существующий порядок, просто создаём новый каталог, куда и монтируем образ:
Далее нужно сделать файлы доступными по сети для чтения установщиком. Как я говорил выше, у меня для этого служит Samba. Поэтому открываем файл конфигурации и добавляем новую шару, добавив такую секцию:
Должно работать поверх дефолтных настроек Samba. Если же не работает, то скорее всего вы что-то меняли сами, а значит найдёте как решить проблему. Итак мы добавили шару mint, через которую можно с сети получить файлы для установки. Не забудьте перезапустить Samba для принятия новых настроек.
Для Archlinux:
Для Gentoo:
Далее нужно подготовить сетевой загрузчик. В этом нам поможет программа tftp-hpa. В Archlinux и в Gentoo пакет называется именно так. Нужно расположить файлы загрузчика в рабочем каталоге ftp-сервера (в арче /srv/tftp). Копируем туда ядро и initrd со смонтированного образа:
Далее нам нужен syslinux. С него нужно собственно PXE-загрузчик:
Далее нужно подготовить файл конфигурации для загрузчика. Для этого создаём файл /srv/tftp/pxelinux.cfg/default. Туда пишем такое:
Где 192.168.0.1 — наш IP-адрес относительно машины, на которую быдем ставить. Ах да, и про nfs там — это не опечатка, в режиме работы с cifs, нужно передавать опции типа как для nfs, не могу сказать почему. Особое внимание нужно обратить на опцию toram, поскольку без неё всё отваливается на полпути и загрузится мы не можем (может это особенности самбы). Но с этой опцией нужно помнить о том, что на целевой машине должно быть достаточно оперативки, чтобы скопировать туда установщик. TFTP-сервер нужно запустить. Для Archlinux:
Для Gentoo:
Теперь нужно биосу целевой машины как-то сказать откуда грузится. В этом нам поможет dnsmasq (хотя не обязательно, можно использовать и другой DHCP сервер, здесь описываю то, что было под рукой). Настраиваем раздачу IP (опция dhcp-range) на своё усмотрение, под свою «сеть» между машинами. Для установки нам важны лишь три опции:
Их нужно добавить к конфигурации dnsmasq, ну и естественно запустить его (или перезапустить).
Для Archlinux:
Для Gentoo:
Помните, чтобы всё заработало необходимо, чтобы порты на DHCP (UDP 67,68), TFTP (UDP 69), Samba (UDP 137,138, TCP 139,445) должны быть обязательно открыты, обязательно учтите это в конфигурации своего фаерволла. Если же фаерволла нет или полностью открыт интерфейс — ну и ладно, должно работать.
Вобщем далее подключаемся к сети (куда смотрят dnsmasq, tftp-hpa и samba), выбиарем Network boot и ставим систему. По завершении останавливаем серверы, размонтируем ISO.
Примечание: в связи с тем, что системы постоянно обновляются, приведённые пути файлов могут оказаться недействительными, то есть отличными от тех, что на Вашей системе. Поэтому внимательно смотрите на структуру пакетов Вашей системы.