pypxe / PyPXE

Pure Python PXE (DHCP-(Proxy)/TFTP/HTTP/NBD) Server
MIT License
539 stars 125 forks source link

CAN use in windows? #174

Closed m986883511 closed 1 year ago

m986883511 commented 4 years ago

I want to use in windwos ,but does not effect.

set = { "ip":"10.90.116.248", 'port':8088, } from pypxe import http from pypxe import tftp from pypxe import dhcp dhcp.DHCPD() tftp.TFTPD(set) http.HTTPD(set)

while True: pass

icb- commented 4 years ago

Windows may work, but as I don't have any Windows systems to test on, I can't say for sure if it does, or provide much help if it doesn't. At a minimum, getting the DHCP server to work is going to take quite a bit more than you've given there. Look at pypxe.server for what's needed, or the pypxe command that gets installed with the module.

kongwei commented 3 years ago

PyPXE can used in windows. Turn off firewall and retry.

BiatuAutMiahn commented 1 year ago
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\****\AppData\Local\Programs\Python\Python311\Lib\site-packages\pypxe\dhcp.py", line 135, in __init__
    signal.signal(signal.SIGALRM, self.export_leases)
                  ^^^^^^^^^^^^^^
AttributeError: module 'signal' has no attribute 'SIGALRM'. Did you mean: 'SIGABRT'?
icb- commented 1 year ago

Please put unrelated problems in new issues.

BiatuAutMiahn commented 1 year ago

THis is related to the issue, when I tried running dhcp.DHCPD() on windows I got that error.

icb- commented 1 year ago

v1.8.4 moves the signal handling to pypxe.server. Please update to that. Windows appears to not support SIGALRM, so you should be able to just comment out registering that signal handler. I don't have a Windows system to test on, so I can't help any further than that.