xorriso 自定义ubuntu-22.04 serevr 镜像,在虚拟机上安装,报错Unable to Find a Medium Containing a Live File System

系统安装、升级讨论
版面规则
我们都知道新人的确很菜,也喜欢抱怨,并且带有浓厚的Windows习惯,但既然在这里询问,我们就应该有责任帮助他们解决问题,而不是直接泼冷水、简单的否定或发表对解决问题没有任何帮助的帖子。乐于分享,以人为本,这正是Ubuntu的精神所在。
回复
舞蹈的熊熊
帖子: 5
注册时间: 2024-07-23 21:29
系统: windows

xorriso 自定义ubuntu-22.04 serevr 镜像,在虚拟机上安装,报错Unable to Find a Medium Containing a Live File System

#1

帖子 舞蹈的熊熊 » 2024-07-23 21:45

执行的打包镜像命令如下

代码: 全选

xorriso -as mkisofs \
    -o "$new_iso"\
    -V 'Ubuntu-Server 22.04.3 LTS amd64' \
    --grub2-mbr --interval:local_fs:0s-15s:zero_mbrpt,zero_gpt:'ubuntu-22.04.3-live-server-amd64.iso' \
    --protective-msdos-label \
    -partition_cyl_align off \
    -partition_offset 16 \
    --mbr-force-bootable \
    -append_partition 2 28732ac11ff8d211ba4b00a0c93ec93b --interval:local_fs:4156048d-4166115d::'ubuntu-22.04.3-live-server-amd64.iso' \
    -appended_part_as_gpt \
    -iso_mbr_part_type a2a0d0ebe5b9334487c068b6b72699c7 \
    -c '/boot.catalog' \
    -b '/boot/grub/i386-pc/eltorito.img' \
    -no-emul-boot \
    -boot-load-size 4 \
    -boot-info-table \
    --grub2-boot-info \
    -eltorito-alt-boot \
    -e '--interval:appended_partition_2_start_1039012s_size_10068d:all::' \
    -no-emul-boot \
    -boot-load-size 10068 \
    /var/lib/vz/template/iso/custom_ubuntu
编译成功,在虚拟机上安装,选择install server安装之后,提示Unbale to find a medium containing a live file system。

在网上找了篇帖子
https://github.com/YasuhiroABE/ub-autoinstall-iso
参照改方法,make geniso成功编译镜像,但是安装提示

代码: 全选

Booting from Hard Disk
Boot failed:bnot a bootable disk

Booting from DEV/CD...
请教各位大神,怎么解决这个问题呀,想在官方镜像里加点自己要安装的组件,结果打包安装这一步都还没过,救救孩子吧

我的grub.cfg文件

代码: 全选

set timeout=30

loadfont unicode

set menu_color_normal=white/black
set menu_color_highlight=black/light-gray

menuentry "Install Ubuntu Server" {
	set gfxpayload=keep
    linux	/casper/vmlinuz autoinstall ds='nocloud-net' \;s=/cdrom/  
	initrd	/casper/initrd
}
menuentry "Ubuntu Server with the HWE kernel" {
	set gfxpayload=keep
	linux	/casper/hwe-vmlinuz  ---
	initrd	/casper/hwe-initrd
}
grub_platform
if [ "$grub_platform" = "efi" ]; then
menuentry 'Boot from next volume' {
	exit 1
}
menuentry 'UEFI Firmware Settings' {
	fwsetup
}
else
menuentry 'Test memory' {
	linux16 /boot/memtest86+.bin
}
fi
头像
astolia
论坛版主
帖子: 6703
注册时间: 2008-09-18 13:11

Re: xorriso 自定义ubuntu-22.04 serevr 镜像,在虚拟机上安装,报错Unable to Find a Medium Containing a Live File System

#2

帖子 astolia » 2024-07-25 15:20

你是不是把原始iso文件挂载后,再将里面的文件复制到/var/lib/vz/template/iso/custom_ubuntu下面的?
我试了一下,iso里面有个隐藏目录.disk,如果你没把这个复制过去,用xorriso制作的iso就会报你那个错
舞蹈的熊熊
帖子: 5
注册时间: 2024-07-23 21:29
系统: windows

Re: xorriso 自定义ubuntu-22.04 serevr 镜像,在虚拟机上安装,报错Unable to Find a Medium Containing a Live File System

#3

帖子 舞蹈的熊熊 » 2024-07-25 18:21

astolia 写了: 2024-07-25 15:20 你是不是把原始iso文件挂载后,再将里面的文件复制到/var/lib/vz/template/iso/custom_ubuntu下面的?
我试了一下,iso里面有个隐藏目录.disk,如果你没把这个复制过去,用xorriso制作的iso就会报你那个错
谢谢大佬,太感激了,哈哈哈。 按照你的这个方法试了,将.disk文件夹拷贝进去再用xorriso打包再安装就没有这个报错了。我用的Debian打包的镜像,ls -l完全没注意到少了这个隐藏文件夹
回复