개요
Windows 부트로더(bootmgr)에서는 리눅스 부팅을 위한 GRUB로의 Chainloading을 지원하지 않으므로 GRUB가 1차 부트로더가 되어야 한다. GRUB는 이미 설치되어 있으므로 GRUB 관련 Config 파일만 설정해주면 된다.
grub.cfg
기본적으로 GRUB는 boot/grub에 설치된다. boot/grub/grub.cfg 파일이 GRUB의 부팅 설정 파일이며, 해당 파일을 GRUB 문법에 맞게 수정하여 여러 부팅 이미지를 로드한다.
if loadfont /boot/grub/font.pf2 ; then set gfxmode=auto insmod efi_gop insmod efi_uga insmod gfxterm terminal_output gfxterm fi if [ $grub_platform = pc ] ; then set menu_color_normal=black/light-gray set menu_color_highlight=white/magenta fi if [ $grub_platform = efi ] ; then set menu_color_normal=black/light-gray set menu_color_highlight=white/red fi set default=3 set timeout=-1 menuentry 'Master bootloader' {true} if [ $grub_platform = pc ] ; then menuentry 'This system has been booted to the Legacy BIOS platform with USB.' {true} fi if [ $grub_platform = efi ] ; then menuentry 'This system has been booted to the EFI platform with USB.' {true} fi menuentry '--------------------------------------------------------------' {true} menuentry 'Chainloading Windows Boot Manager' { chainloader /EFI/BOOT/bootmgfw.efi } menuentry 'Boot ubuntu-18.04.6-desktop-amd64' { set iso_path='/iso/ubuntu-18.04.6-desktop-amd64.iso' loopback loop $iso_path linux (loop)/casper/vmlinuz boot=/casper file=/preseed/ubuntu.seed iso-scan/filename=$iso_path noeject noprompt splash -- initrd (loop)/casper/initrd } menuentry 'Install ubuntu-18.04.6-server-amd64' { set iso_path='/iso/ubuntu-18.04.6-server-amd64.iso' loopback loop $iso_path set gfxpayload=keep linux (loop)/install/vmlinuz boot=/install file=/preseed/ubuntu-server.seed iso-scan/filename=$iso_path noeject noprompt splash -- initrd (loop)/install/initrd.gz } menuentry 'Boot ubuntu-20.04-desktop-amd64' { set iso_path='/iso/ubuntu-20.04-desktop-amd64.iso' search --set -f $iso_path loopback loop $iso_path linux (loop)/casper/vmlinuz boot=/casper file=/preseed/ubuntu.seed iso-scan/filename=$iso_path noeject noprompt splash -- initrd (loop)/casper/initrd } menuentry 'Install ubuntu-20.04-server-amd64' { set iso_path='/iso/ubuntu-20.04-legacy-server-amd64.iso' search --set -f $iso_path # set gfxpayload=keep loopback loop $iso_path linux (loop)/install/vmlinuz boot=/install file=/preseed/ubuntu-server.seed iso-scan/filename=$iso_path noeject noprompt splash -- initrd (loop)/install/initrd.gz } menuentry '--------------------------------------------------------------' {true} menuentry 'System Firmware Settings' { fwsetup } menuentry 'System Reboot' { reboot } menuentry 'System Shutdown' { halt } menuentry 'Exit GRUB' { exit }
Ubuntu Server ISO 파일을 로드하는 경우 cd-rom 마운트가 되지 않는 문제가 발생한다. 수동으로 Ubuntu Server ISO 파일을 마운트하는 과정이 필요하다.