The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 807 - File: showthread.php PHP 7.3.15 (Linux)
File Line Function
/showthread.php 807 errorHandler->error

Post Reply 
Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[HOWTO] Using QNAP TS-221 as PXE server / iscsi target.
2013-09-06, 12:48 (This post was last modified: 2013-09-06 13:20 by jrsmile.)
Post: #1
[HOWTO] Using QNAP TS-221 as PXE server / iscsi target.
Hi there, i finally managed to get a Win7 booting via iscsi.
this is how i did it.

activate tftp server:
go to the NAS Webinterface and login with admin and your password.
open "Control Panel" then select "Applications" and "TFTP-Server"
on the right side select enable TFTP-Server use Port 69 and select a base folder.
Mine is called /PXE and was created especially for this reason with read only permissions.
download undionly.kpxe from here: and put it into the PXE folder.

then add a go.ipxe file with the following content:
set keep-san 1
#set skip-san-boot 1

thats it for the TFTP section now comes ISCSI.

in the "Control Panel" open the "Storage Manager" and and select the "ISCSI" tab.
under "Portal Management" "Enable ISCSI Target Service" on Port 3260.

under "Target Management" select "Quick Configuration wizzard" and create a iscsi target and LUN with your desired configuration. (Skip CHAP-auth and Mutual CHAP-auth)

in the "Summary Screen" write down the iqn path to your drive and adapt the go.ipxe file in your PXE folder to the correct name.
For example:
means connect to and fetch

now make sure you have the "Optware IPKG" Software installed via the "APP Center"
connect via ssh to your QNAP and issue the following commands.
ipkg update
ipkg install dnsmasq
(i did a "ipkg install nano" as well)
now edit the /opt/etc/dnsmasq.conf file and replace its content with:
pxe-service=net:#ipxe,x86PC, "lanboot", undionly.kpxe
user and group have to be admin and administrators to be able to start dnsmasq on the qnap. the port 0 disables the dnsmasq inbuild dns server.
dhcp-match identifies if a normal pxe or a ipxe client connects to the server.
pxe-service is needed as the dnsmasq service runs as dhcp-proxy and does not issue ip adresses to the client ( this is done by your existing router/dhcp server)
adapt all ips to your local network configuration.
the dhcp-range command specifies the proxy-dhcp method instead of a real dhcp server. any ip from the subnet can be specified so i took the to make this more visible the ",proxy" part enables the dhcp-proxy.

configuration summary:
dnsmasq only configured as dhcp-proxy
issues undionly.kpxe to all pxe clients
issues tftp://<nas-ip>/go.ipxe to all ipxe clients.

save the file and start dnsmasq via "/opt/etc/init.d/S56dnsmasq"
make sure it runs with "ps -aux | grep dnsmasq"
it should show:
[/etc/config] # ps -aux | grep dnsmasq    
2021 admin       484 S   grep dnsmasq
8345 admin       572 S   /opt/sbin/dnsmasq
[/etc/config] #

to install win 7 you have to uncomment the #set skip-san-boot 1 in /PXE/go.ipxe
otherwise it will not select the cd-rom after a failed sanboot. after installation you can comment it with a # again.

fire up KVM or QEMU and boot via PXE to test (VirtualBox does not work as it stops after a failed sanboot!!!).

specify Network boot and use a win7 iso as second boot option.
if everything went well you will be able to select the iscsi target as Harddrive during windows installation. if it is left blank check your configuration again.
dont forget to comment out set skip-san-boot 1 after first reboot.

ps: if you want to start dnsmasq during NAS bootup have a look here:
and use the QPKG based method.

Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 

Messages In This Thread
[HOWTO] Using QNAP TS-221 as PXE server / iscsi target. - jrsmile - 2013-09-06 12:48

User(s) browsing this thread: 1 Guest(s)