﻿id,summary,reporter,owner,description,type,status,component,version,resolution,keywords,cc,guest,host
20589,"NAT TFTP: leading slash in path cause ""Access violation""",lfmeloman,,"I was trying to boot Grub2 using the built-in NAT TFTP. However, after being successfully loaded by iPXE Grub fails to load the additional files (/boot/grub/i386-pc/normal.mod, etc.) printing: error: Access violation

Same error is returned by NAT TFTP when using a tftp client on a booted Gust OS when the requested path has a leading forward slash.

Workaround: switch to an alternative TFTP server on localhost:
{{{
VBoxManage modifyvm SLESInst --nattftpserver1 10.0.2.2
}}}
Steps to reproduce:

- Generate Grub dir without grub.cfg or vmlinuz/initrd (they're not needed for testing)
{{{
[root@reallin il]# grub-mknetdir --net-directory=/srv/tftp --subdir=/boot/grub -d /usr/lib/grub/i386-pc
Netboot directory for i386-pc created. Configure your DHCP server to point to /srv/tftp/boot/grub/i386-pc/core.0
}}}
- Copy the files to the default TFTPPrefix
{{{
cp -rT /srv/tftp/boot ~/.VirtualBox/TFTP/boot
}}}
- point the VBox DHCP server to the right file
{{{
# If I use leading slash here boot fails sooner
VBoxManage modifyvm MyVM --nattftpfile1=boot/grub/i386-pc/core.0
}}}
- Boot a guest from Network

Expected: Grub loads in ""Normal"" mode

Actual: Grub loads in ""Rescue"" mode.

Additional info:
{{{
[il@reallin ~]$ atftp 10.0.2.4
tftp> get boot/grub/i386-pc/core.0
Overwrite local file [y/n]? y
tftp> get /boot/grub/i386-pc/core.0
Overwrite local file [y/n]? y
tftp: error received from server <Access violation>
tftp: aborting
tftp> 
}}} 
",defect,new,network/NAT,VirtualBox 6.1.26,,,,Linux,Windows
