当前位置: 首页 > news >正文

如何使用ubuntu搭建一个无盘PC启动服务器

启动windows,1. 安装tftp服务器sudo apt install tftpd-hpa2. 设置tftp,sudo systemctl restart tftpd-hpasudo nano /etc/default/tftpd-hpa # /etc/default/tftpd-hpa TFTP_USERNAMEtftp TFTP_DIRECTORY/srv/tftp TFTP_ADDRESS:69 TFTP_OPTIONS--secure --create3. 安装dhcp服务器sudo apt install isc-dhcp-server4. 设置dhcp服务器的工作网卡sudo nano /etc/default/isc-dhcp-server # Defaults for isc-dhcp-server (sourced by /etc/init.d/isc-dhcp-server) # Path to dhcpds config file (default: /etc/dhcp/dhcpd.conf). #DHCPDv4_CONF/etc/dhcp/dhcpd.conf #DHCPDv6_CONF/etc/dhcp/dhcpd6.conf # Path to dhcpds PID file (default: /var/run/dhcpd.pid). #DHCPDv4_PID/var/run/dhcpd.pid #DHCPDv6_PID/var/run/dhcpd6.pid # Additional options to start dhcpd with. # Dont use options -cf or -pf here; use DHCPD_CONF/ DHCPD_PID instead #OPTIONS # On what interfaces should the DHCP server (dhcpd) serve DHCP requests? # Separate multiple interfaces with spaces, e.g. eth0 eth1. INTERFACESv4ens34 INTERFACESv65. 设置dhcp的工作网段,sudo systemctl restart isc-dhcp-serversudo vi /etc/dhcp/dhcpd.conf # Global parameter options for the PXE network environment default-lease-time 600; max-lease-time 7200; authoritative; # Log DHCP actions to the system log (/var/log/syslog) log-facility local7; # Subnet profile bound strictly to the 10.10.1.0/24 infrastructure subnet 10.10.1.0 netmask 255.255.255.0 { range 10.10.1.10 10.10.1.50; # IP pool reserved for PXE clients option subnet-mask 255.255.255.0; option broadcast-address 10.10.1.255; # Point clients directly to your Ubuntu TFTP service configuration next-server 10.10.1.100; # Server IP hosting your TFTP files filename undionly.kpxe; # Network boot loader payload filename }6. 安装iscitargetcli-fbsudo apt update sudo apt install -y targetcli-fb7. 创建一个磁盘文件sudo mkdir -p /var/iscsi_disks8. 配置iscsi# 1. Register the image file into the LIO backend allocator /backstores/fileio create namedisk01 file_or_dev/var/iscsi_disks/disk01.img size6G # 2. Create your Unique iSCSI Target Name (IQN) /iscsi create iqn.2026-05.ubuntu.storage:target01 # 3. Create a Logical Unit Number (LUN) mapping the storage block to your IQN cd /iscsi/iqn.2026-05.ubuntu.storage:target01/tpg1/luns create /backstores/fileio/disk01 # 4. Define which client is allowed to connect (ACL) # For testing, map it to the standard iPXE initiator name cd ../acls create iqn.2010-04.org.ipxe:initiator cd /iscsi/iqn.2026-05.ubuntu.storage:target01/tpg1 # Permit any initiator to connect without an explicit ACL entry set attribute generate_node_acls1 # Allow write operations for these dynamically created client nodes set attribute cache_dynamic_acls1 # Turn off explicit CHAP (username/password) validation mechanisms set attribute authentication0 set attribute demo_mode_write_protect0 cd / saveconfig exit9. 打开防火墙,启动服务sudo ufw allow to any port 3260 proto tcp sudo systemctl enable target sudo systemctl restart target sudo systemctl status target10. 编写ipxe脚本,boot.ipxe#!ipxe dhcp sanboot iscsi:10.10.1.100::::iqn.2026-05.ubuntu.storage:target0111. 下载的编译ipxegit clone https://github.com/ipxe/ipxe.git cd ipxe/src sudo apt install gcc sudo apt install make sudo apt install liblzma-dev make bin-x86_64-pcbios/undionly.kpxe EMBEDboot.ipxe cp bin-x86_64-pcbios/undionly.kpxe /srv/tftp11. 在同一个网段启动目标pc 先使用sanhook和winpe进入系统分区DISKPART list disk DISKPART select disk [Your iSCSI Disk Number] DISKPART clean DISKPART convert mbr DISKPART create partition primary DISKPART select partition 1 DISKPART active DISKPART format quick fsntfs labelWinPE_BIOS DISKPART assign letterC DISKPART exit12. 安装系统到 C:dism /Apply-Image /ImageFile:Z:\path\to\boot.wim /Index:1 /ApplyDir:C:\13. 安装bootloaderbcdboot C:\Windows /s C: /f BIOS14. 修改注册表msiscsi的设置reg load HKLM\TARGET_SYSTEM C:\Windows\System32\config\SYSTEM reg add HKLM\TARGET_SYSTEM\ControlSet001\Services\Ndis /v Start /t REG_DWORD /d 0 /f reg add HKLM\TARGET_SYSTEM\ControlSet001\Services\msiscsi /v Start /t REG_DWORD /d 0 /f reg add HKLM\TARGET_SYSTEM\Setup /v SystemSetupInProgress /t REG_DWORD /d 1 /f reg unload HKLM\TARGET_SYSTEM15. 禁用早段网络reg load HKLM\TARGET_SYSTEM C:\Windows\System32\config\SYSTEM :: Add the override parameter to skip standard initialization reg add HKLM\TARGET_SYSTEM\Setup /v DisableWpeinitNetwork /t REG_DWORD /d 1 /f :: Disable the NDIS lightweight filter driver execution path reg add HKLM\TARGET_SYSTEM\ControlSet001\Services\NdisWdf /v Start /t REG_DWORD /d 4 /f reg unload HKLM\TARGET_SYSTEM16. 修改使用ipxe.pxe作为bootfilemake bin-x86_64-pcbios/ipxe.pxe EMBEDboot.ipxe cp bin-x86_64-pcbios/ipxe.pxe /srv/tftp #make bin-x86_64-pcbios/undionly.kpxe EMBEDboot.ipxe #cp bin-x86_64-pcbios/undionly.kpxe /srv/tftp17. 修改boot.ipex#!ipxe dhcp set keep-san 1 set net0.dhcp/gateway 0.0.0.0 sanboot --keep iscsi:10.10.1.100::::iqn.2026-05.ubuntu.storage:target01
http://www.gsyq.cn/news/1296761.html

相关文章:

  • 企业如何选择合适的智能客服系统?关键考量因素全解析 - 品牌2025
  • AI智能体开发脚手架:从零到一构建自主任务执行系统
  • 为什么MarkText能成为开发者最爱的Markdown编辑器?深度解析其技术架构与用户体验
  • AI助手越权了?南加州大学等揭示大模型代理的“权限失控“问题
  • 运算放大器增益带宽积(GBW)计算指南:从原理到选型实战
  • 基于CircuitPython与Feather RP2040的智能LED火箭氛围灯制作全攻略
  • Doramagic开源工具箱:开发者效率提升的模块化实践
  • 2026年成人纸尿裤经济型选购指南:3款主流高性价比产品深度解析与场景适配 - 产业观察网
  • 4个关键阶段:终极解决Windows Defender异常问题的完整指南
  • AI智能体操作Android应用:架构、实现与自动化测试新范式
  • Xenia Canary:在PC上复活Xbox 360游戏的技术革命
  • Cursor Pro永久免费使用指南:5步解决试用限制问题
  • AI提示词工程实战:从Awesome Prompts项目学习高效人机协作
  • 开源AI助手插件:为HuluNote笔记软件集成智能文本处理与知识管理
  • Halbot框架解析:从零构建可扩展聊天机器人的实践指南
  • 2026年呼叫中心等保合规收紧:厂商怎么选,企业怎么准备 - 品牌2025
  • Hermes Agent框架无缝对接Taotoken作为自定义模型提供商
  • QtScrcpy终极指南:如何免费实现高清Android投屏与多设备控制
  • 嵌入式C语言编码规范:从可读性到稳定性的工程实践指南
  • 【Appium 系列】第12节-智能路由 — API测试 vs UI 测试的自动选择
  • 突破性ARM架构兼容方案:Box86揭秘x86程序在ARM设备上的运行奥秘
  • 生成式AI入门实战:从零搭建智能应用的全流程指南
  • 使用Nodejs开发后端服务如何集成Taotoken调用多模型API
  • 零编程DIY柔性硅胶霓虹LED灯带:低成本打造专属自拍背景墙
  • BLE GATT客户端开发实战:从服务发现到数据解析
  • 【权威实测】ElevenLabs匈牙利语发音准确率仅83.7%?我们用CEFR B2-C1语料库做了276次压力测试
  • 大理与四川茶园:中国旅游新玩法,小红书成关键助力!
  • 国产多模态大模型“看图说话”指南:原理、应用与未来
  • Pearcleaner终极指南:如何彻底清理Mac应用残留,释放宝贵存储空间?
  • 在企业内部搭建AI服务中台如何利用Taotoken进行统一纳管