저는 현재 Xen 4.12가 설치된 Debian 10을 실행하고 있습니다. 다음 단계에 따라 다른 컴퓨터의 소스에서 Xen을 컴파일했습니다.
- ./configure --target=x86_64 --with-platform=efi --enable-systemd
- 세상을 창조하다
- 배포하기
- 데바
그런 다음 Debian 10 호스트에 Xen 패키지를 설치했습니다. 또한 바닐라 커널(5.3.8)을 컴파일하여 Debian 10 호스트에 설치했습니다.
이제 모든 것이 정상이지만 Xen 하이퍼바이저를 로드한 후에는 coretemp와 같은 다른 모듈을 로드할 수 없습니다.
root@xen1:/# modprobe coretemp
modprobe: ERROR: could not insert 'coretemp': No such device
root@xen1:/# uname -a
Linux xen1 5.3.8 #1 SMP Wed Nov 6 13:42:42 CET 2019 x86_64 GNU/Linux
root@xen1:/# ll /usr/lib/modules/5.3.8/kernel/drivers/hwmon/coretemp.ko
-rw-r--r-- 1 root root 24872 Nov 6 13:41 /usr/lib/modules/5.3.8/kernel/drivers/hwmon/coretemp.ko
Xen 하이퍼바이저 없이 호스트를 부팅할 때 문제 없이 coretemp 모듈을 로드할 수 있습니다.
구성에 문제가 있습니까(아마도 그럽)? 아래에서 현재 grub 구성을 찾으십시오.
root@xen1:/# cat /boot/grub/grub.cfg
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#
### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
set have_grubenv=true
load_env
fi
if [ "${next_entry}" ] ; then
set default="${next_entry}"
set next_entry=
save_env next_entry
set boot_once=true
else
set default="Debian GNU/Linux, with Xen hypervisor"
fi
if [ x"${feature_menuentry_id}" = xy ]; then
menuentry_id_option="--id"
else
menuentry_id_option=""
fi
export menuentry_id_option
if [ "${prev_saved_entry}" ]; then
set saved_entry="${prev_saved_entry}"
save_env saved_entry
set prev_saved_entry=
save_env prev_saved_entry
set boot_once=true
fi
function savedefault {
if [ -z "${boot_once}" ]; then
saved_entry="${chosen}"
save_env saved_entry
fi
}
function load_video {
if [ x$feature_all_video_module = xy ]; then
insmod all_video
else
insmod efi_gop
insmod efi_uga
insmod ieee1275_fb
insmod vbe
insmod vga
insmod video_bochs
insmod video_cirrus
fi
}
if [ x$feature_default_font_path = xy ] ; then
font=unicode
else
insmod part_gpt
insmod lvm
insmod ext2
set root='lvmid/bvbEzC-juKi-DnNc-yxrz-7KHu-uh1P-n6EPWK/tkAuXS-e4Gq-DY98-kkIY-nNf3-4fxn-u8QT2G'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint='lvmid/bvbEzC-juKi-DnNc-yxrz-7KHu-uh1P-n6EPWK/tkAuXS-e4Gq-DY98-kkIY-nNf3-4fxn-u8QT2G' 988e72e2-cc10-46d6-9cd8-3b58827fe864
else
search --no-floppy --fs-uuid --set=root 988e72e2-cc10-46d6-9cd8-3b58827fe864
fi
font="/usr/share/grub/unicode.pf2"
fi
if loadfont $font ; then
set gfxmode=auto
load_video
insmod gfxterm
set locale_dir=$prefix/locale
set lang=en_GB
insmod gettext
fi
terminal_output gfxterm
if [ "${recordfail}" = 1 ] ; then
set timeout=30
else
if [ x$feature_timeout_style = xy ] ; then
set timeout_style=menu
set timeout=5
# Fallback normal timeout code in case the timeout_style feature is
# unavailable.
else
set timeout=5
fi
fi
### END /etc/grub.d/00_header ###
### BEGIN /etc/grub.d/05_debian_theme ###
set menu_color_normal=cyan/blue
set menu_color_highlight=white/blue
### END /etc/grub.d/05_debian_theme ###
### BEGIN /etc/grub.d/08_linux_xen ###
menuentry 'Debian GNU/Linux, with Xen hypervisor' --class debian --class gnu-linux --class gnu --class os --class xen $menuentry_id_option 'xen-gnulinux-simple-988e72e2-cc10-46d6-9cd8-3b58827fe864' {
insmod part_gpt
insmod ext2
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root e9e6e232-aef7-4e2e-ac20-cd8b218952b1
else
search --no-floppy --fs-uuid --set=root e9e6e232-aef7-4e2e-ac20-cd8b218952b1
fi
echo 'Loading Xen 4.12.2-pre ...'
if [ "$grub_platform" = "pc" -o "$grub_platform" = "" ]; then
xen_rm_opts=
else
xen_rm_opts="no-real-mode edd=off"
fi
multiboot2 /xen-4.12.2-pre.gz placeholder dom0_mem=2560M,max:2560M ${xen_rm_opts}
echo 'Loading Linux 5.3.8 ...'
module2 /vmlinuz-5.3.8 placeholder root=/dev/mapper/vg00-lvroot ro quiet pcie_aspm=force
echo 'Loading initial ramdisk ...'
module2 --nounzip /initrd.img-5.3.8
}
submenu 'Advanced options for Debian GNU/Linux (with Xen hypervisor)' $menuentry_id_option 'gnulinux-advanced-988e72e2-cc10-46d6-9cd8-3b58827fe864' {
submenu 'Xen hypervisor, version 4.12.2-pre' $menuentry_id_option 'xen-hypervisor-4.12.2-pre-988e72e2-cc10-46d6-9cd8-3b58827fe864' {
menuentry 'Debian GNU/Linux, with Xen 4.12.2-pre and Linux 5.3.8' --class debian --class gnu-linux --class gnu --class os --class xen $menuentry_id_option 'xen-gnulinux-5.3.8-advanced-988e72e2-cc10-46d6-9cd8-3b58827fe864' {
insmod part_gpt
insmod ext2
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root e9e6e232-aef7-4e2e-ac20-cd8b218952b1
else
search --no-floppy --fs-uuid --set=root e9e6e232-aef7-4e2e-ac20-cd8b218952b1
fi
echo 'Loading Xen 4.12.2-pre ...'
if [ "$grub_platform" = "pc" -o "$grub_platform" = "" ]; then
xen_rm_opts=
else
xen_rm_opts="no-real-mode edd=off"
fi
multiboot2 /xen-4.12.2-pre.gz placeholder dom0_mem=2560M,max:2560M ${xen_rm_opts}
echo 'Loading Linux 5.3.8 ...'
module2 /vmlinuz-5.3.8 placeholder root=/dev/mapper/vg00-lvroot ro quiet pcie_aspm=force
echo 'Loading initial ramdisk ...'
module2 --nounzip /initrd.img-5.3.8
}
menuentry 'Debian GNU/Linux, with Xen 4.12.2-pre and Linux 5.3.8 (recovery mode)' --class debian --class gnu-linux --class gnu --class os --class xen $menuentry_id_option 'xen-gnulinux-5.3.8-recovery-988e72e2-cc10-46d6-9cd8-3b58827fe864' {
insmod part_gpt
insmod ext2
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root e9e6e232-aef7-4e2e-ac20-cd8b218952b1
else
search --no-floppy --fs-uuid --set=root e9e6e232-aef7-4e2e-ac20-cd8b218952b1
fi
echo 'Loading Xen 4.12.2-pre ...'
if [ "$grub_platform" = "pc" -o "$grub_platform" = "" ]; then
xen_rm_opts=
else
xen_rm_opts="no-real-mode edd=off"
fi
multiboot2 /xen-4.12.2-pre.gz placeholder ${xen_rm_opts}
echo 'Loading Linux 5.3.8 ...'
module2 /vmlinuz-5.3.8 placeholder root=/dev/mapper/vg00-lvroot ro single
echo 'Loading initial ramdisk ...'
module2 --nounzip /initrd.img-5.3.8
}
menuentry 'Debian GNU/Linux, with Xen 4.12.2-pre and Linux 4.19.0-6-amd64' --class debian --class gnu-linux --class gnu --class os --class xen $menuentry_id_option 'xen-gnulinux-4.19.0-6-amd64-advanced-988e72e2-cc10-46d6-9cd8-3b58827fe864' {
insmod part_gpt
insmod ext2
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root e9e6e232-aef7-4e2e-ac20-cd8b218952b1
else
search --no-floppy --fs-uuid --set=root e9e6e232-aef7-4e2e-ac20-cd8b218952b1
fi
echo 'Loading Xen 4.12.2-pre ...'
if [ "$grub_platform" = "pc" -o "$grub_platform" = "" ]; then
xen_rm_opts=
else
xen_rm_opts="no-real-mode edd=off"
fi
multiboot2 /xen-4.12.2-pre.gz placeholder dom0_mem=2560M,max:2560M ${xen_rm_opts}
echo 'Loading Linux 4.19.0-6-amd64 ...'
module2 /vmlinuz-4.19.0-6-amd64 placeholder root=/dev/mapper/vg00-lvroot ro quiet pcie_aspm=force
echo 'Loading initial ramdisk ...'
module2 --nounzip /initrd.img-4.19.0-6-amd64
}
menuentry 'Debian GNU/Linux, with Xen 4.12.2-pre and Linux 4.19.0-6-amd64 (recovery mode)' --class debian --class gnu-linux --class gnu --class os --class xen $menuentry_id_option 'xen-gnulinux-4.19.0-6-amd64-recovery-988e72e2-cc10-46d6-9cd8-3b58827fe864' {
insmod part_gpt
insmod ext2
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root e9e6e232-aef7-4e2e-ac20-cd8b218952b1
else
search --no-floppy --fs-uuid --set=root e9e6e232-aef7-4e2e-ac20-cd8b218952b1
fi
echo 'Loading Xen 4.12.2-pre ...'
if [ "$grub_platform" = "pc" -o "$grub_platform" = "" ]; then
xen_rm_opts=
else
xen_rm_opts="no-real-mode edd=off"
fi
multiboot2 /xen-4.12.2-pre.gz placeholder ${xen_rm_opts}
echo 'Loading Linux 4.19.0-6-amd64 ...'
module2 /vmlinuz-4.19.0-6-amd64 placeholder root=/dev/mapper/vg00-lvroot ro single
echo 'Loading initial ramdisk ...'
module2 --nounzip /initrd.img-4.19.0-6-amd64
}
}
}
### END /etc/grub.d/08_linux_xen ###
### BEGIN /etc/grub.d/10_linux ###
function gfxmode {
set gfxpayload="${1}"
}
set linux_gfx_mode=
export linux_gfx_mode
menuentry 'Debian GNU/Linux' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-988e72e2-cc10-46d6-9cd8-3b58827fe864' {
load_video
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_gpt
insmod ext2
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root e9e6e232-aef7-4e2e-ac20-cd8b218952b1
else
search --no-floppy --fs-uuid --set=root e9e6e232-aef7-4e2e-ac20-cd8b218952b1
fi
echo 'Loading Linux 5.3.8 ...'
linux /vmlinuz-5.3.8 root=/dev/mapper/vg00-lvroot ro quiet pcie_aspm=force
echo 'Loading initial ramdisk ...'
initrd /initrd.img-5.3.8
}
submenu 'Advanced options for Debian GNU/Linux' $menuentry_id_option 'gnulinux-advanced-988e72e2-cc10-46d6-9cd8-3b58827fe864' {
menuentry 'Debian GNU/Linux, with Linux 5.3.8' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-5.3.8-advanced-988e72e2-cc10-46d6-9cd8-3b58827fe864' {
load_video
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_gpt
insmod ext2
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root e9e6e232-aef7-4e2e-ac20-cd8b218952b1
else
search --no-floppy --fs-uuid --set=root e9e6e232-aef7-4e2e-ac20-cd8b218952b1
fi
echo 'Loading Linux 5.3.8 ...'
linux /vmlinuz-5.3.8 root=/dev/mapper/vg00-lvroot ro quiet pcie_aspm=force
echo 'Loading initial ramdisk ...'
initrd /initrd.img-5.3.8
}
menuentry 'Debian GNU/Linux, with Linux 5.3.8 (recovery mode)' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-5.3.8-recovery-988e72e2-cc10-46d6-9cd8-3b58827fe864' {
load_video
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_gpt
insmod ext2
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root e9e6e232-aef7-4e2e-ac20-cd8b218952b1
else
search --no-floppy --fs-uuid --set=root e9e6e232-aef7-4e2e-ac20-cd8b218952b1
fi
echo 'Loading Linux 5.3.8 ...'
linux /vmlinuz-5.3.8 root=/dev/mapper/vg00-lvroot ro single
echo 'Loading initial ramdisk ...'
initrd /initrd.img-5.3.8
}
menuentry 'Debian GNU/Linux, with Linux 4.19.0-6-amd64' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.19.0-6-amd64-advanced-988e72e2-cc10-46d6-9cd8-3b58827fe864' {
load_video
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_gpt
insmod ext2
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root e9e6e232-aef7-4e2e-ac20-cd8b218952b1
else
search --no-floppy --fs-uuid --set=root e9e6e232-aef7-4e2e-ac20-cd8b218952b1
fi
echo 'Loading Linux 4.19.0-6-amd64 ...'
linux /vmlinuz-4.19.0-6-amd64 root=/dev/mapper/vg00-lvroot ro quiet pcie_aspm=force
echo 'Loading initial ramdisk ...'
initrd /initrd.img-4.19.0-6-amd64
}
menuentry 'Debian GNU/Linux, with Linux 4.19.0-6-amd64 (recovery mode)' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.19.0-6-amd64-recovery-988e72e2-cc10-46d6-9cd8-3b58827fe864' {
load_video
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_gpt
insmod ext2
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root e9e6e232-aef7-4e2e-ac20-cd8b218952b1
else
search --no-floppy --fs-uuid --set=root e9e6e232-aef7-4e2e-ac20-cd8b218952b1
fi
echo 'Loading Linux 4.19.0-6-amd64 ...'
linux /vmlinuz-4.19.0-6-amd64 root=/dev/mapper/vg00-lvroot ro single
echo 'Loading initial ramdisk ...'
initrd /initrd.img-4.19.0-6-amd64
}
}
### END /etc/grub.d/10_linux ###
### BEGIN /etc/grub.d/30_os-prober ###
### END /etc/grub.d/30_os-prober ###
### BEGIN /etc/grub.d/30_uefi-firmware ###
menuentry 'System setup' $menuentry_id_option 'uefi-firmware' {
fwsetup
}
### END /etc/grub.d/30_uefi-firmware ###
### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###
### BEGIN /etc/grub.d/41_custom ###
if [ -f ${config_directory}/custom.cfg ]; then
source ${config_directory}/custom.cfg
elif [ -z "${config_directory}" -a -f $prefix/custom.cfg ]; then
source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###
/boot 폴더에는 다음 파일이 포함되어 있습니다.
root@xen1:/# ll /boot/
total 74084
-rw-r--r-- 1 root root 206243 Sep 20 12:51 config-4.19.0-6-amd64
-rw-r--r-- 1 root root 219726 Nov 6 13:41 config-5.3.8
-rw-r--r-- 1 root root 1638 Nov 5 09:37 config-xen-4.12.2-pre
drwx------ 3 root root 4096 Jan 1 1970 efi
drwxr-xr-x 5 root root 4096 Nov 6 15:08 grub
-rw-r--r-- 1 root root 28041914 Nov 5 15:10 initrd.img-4.19.0-6-amd64
-rw-r--r-- 1 root root 28213404 Nov 6 14:45 initrd.img-5.3.8
drwx------ 2 root root 16384 Nov 5 13:32 lost+found
-rw-r--r-- 1 root root 3409486 Sep 20 12:51 System.map-4.19.0-6-amd64
-rw-r--r-- 1 root root 3622883 Nov 6 13:41 System.map-5.3.8
-rw-r--r-- 1 root root 5262576 Sep 20 12:51 vmlinuz-4.19.0-6-amd64
-rw-r--r-- 1 root root 5548416 Nov 6 13:41 vmlinuz-5.3.8
-rw-r--r-- 1 root root 1176799 Nov 5 10:00 xen-4.12.2-pre.gz
시스템 로그의 일부 추가 세부정보:
Nov 7 09:17:48 xen1 systemd-modules-load[228]: Inserted module '8021q'
Nov 7 09:17:48 xen1 systemd-modules-load[228]: Failed to insert module 'coretemp': No such device
Nov 7 09:17:48 xen1 systemd-modules-load[228]: Inserted module 'nct6775'
Nov 7 09:17:48 xen1 systemd-modules-load[228]: Inserted module 'xen_evtchn'
Nov 7 09:17:48 xen1 systemd-modules-load[228]: Inserted module 'xen_gntdev'
Nov 7 09:17:48 xen1 systemd-modules-load[228]: Inserted module 'xen_gntalloc'
Nov 7 09:17:48 xen1 systemd-modules-load[228]: Inserted module 'xen_blkback'
Nov 7 09:17:48 xen1 systemd-modules-load[228]: Inserted module 'xen_netback'
Nov 7 09:17:48 xen1 systemd-modules-load[228]: Inserted module 'xen_pciback'
Nov 7 09:17:48 xen1 systemd-modules-load[228]: Failed to find module 'evtchn'
Nov 7 09:17:48 xen1 systemd-modules-load[228]: Failed to find module 'gntdev'
Nov 7 09:17:48 xen1 systemd-modules-load[228]: Failed to find module 'netbk'
Nov 7 09:17:48 xen1 systemd-modules-load[228]: Failed to find module 'blkbk'
Nov 7 09:17:48 xen1 systemd-modules-load[228]: Failed to find module 'xen-scsibk'
Nov 7 09:17:48 xen1 systemd-modules-load[228]: Failed to find module 'usbbk'
Nov 7 09:17:48 xen1 systemd-modules-load[228]: Failed to find module 'pciback'
Nov 7 09:17:48 xen1 systemd-modules-load[228]: Inserted module 'xen_acpi_processor'
Nov 7 09:17:48 xen1 systemd-modules-load[228]: Failed to find module 'blktap2'
답변1
XEN은 베어메탈 하이퍼바이저입니다. Dom0은 PV(반가상화) XEN VM(가상 머신)입니다.
따라서 Dom0이 아닌 하이퍼바이저가 하드웨어 관리를 담당합니다. 따라서 하드웨어 모듈은 작동하지 않습니다. Dom0에는 하드웨어가 없기 때문입니다.
가상 머신입니다. 하드웨어와 관련된 사항을 변경하려면 XEN 매개변수를 사용하거나 xen에 무언가를 알려주어야 합니다.
권한 있는 VM인 Dom0은 권한이 없는 다른 VM(DomU)이 수행할 수 없는 일부 작업을 하이퍼바이저에 전달할 수 있습니다.