qemu+kvm, 도움이 되지 않는 virt-install --location 오류

qemu+kvm, 도움이 되지 않는 virt-install --location 오류

나는 qemu 및 virt-install과 싸워봤자 아무 소용이 없었으며 전혀 도움이 되지 않는 오류 메시지에 완전히 갇혀버렸습니다.

먼저, 몇 가지 필요한 시스템 구성:

기본 운영 체제는 Ubuntu Server 20.04 LTS입니다. 데스크탑 환경이 없습니다. VM 운영 체제는 Ubuntu Server 18.04 LTS입니다. 데스크탑 환경이 없습니다.

/dragonode이 가상 머신의 기본 스토리지 볼륨으로 사용하려는 60GB LVM이 있습니다 .

calyodelphi@dragonweyr:~$ lsblk
NAME                           MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
[loop partitions omitted]
nvme0n1                        259:0    0   477G  0 disk 
├─nvme0n1p1                    259:1    0   512M  0 part /boot/efi
├─nvme0n1p2                    259:2    0     1G  0 part /boot
└─nvme0n1p3                    259:3    0 475.4G  0 part 
  ├─ubuntu--vg-ubuntu--lv      253:0    0    50G  0 lvm  /
  ├─ubuntu--vg-dragonode--lv   253:1    0    60G  0 lvm  /dragonode
  └─ubuntu--vg-dragonhoard--lv 253:2    0 365.4G  0 lvm  /dragonhoard

시스템의 금속 인터페이스 역할을 하기 위해 netplan을 사용하여 브리지를 성공적으로 구성했습니다.

calyodelphi@dragonweyr:~$ ip link show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eno2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel master br0 state UP mode DEFAULT group default qlen 1000
    link/ether f8:75:a4:b5:ca:ba brd ff:ff:ff:ff:ff:ff
3: wlo1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DORMANT group default qlen 1000
    link/ether 94:e6:f7:36:91:d8 brd ff:ff:ff:ff:ff:ff
4: br0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DEFAULT group default qlen 1000
    link/ether f8:75:a4:b5:ca:ba brd ff:ff:ff:ff:ff:ff

이제 제가 엮은 명령과 문제는 다음과 같습니다.

calyodelphi@dragonweyr:~$ virt-install --name dragonode --ram=2048 --disk path=/dragonode/dragonode.qcow2,size=50,format=qcow2 --vcpus 1 --os-type linux --os-variant ubuntu18.04 --graphics none --network bridge:br0 --location 'http://archive.ubuntu.com/ubuntu/dists/bionic/main/binary-amd64/' --extra-args "console=tty0 console=ttyS0,115200n8 ip=192.168.1.144::192.168.1.1:255.255.255.0:dragonode.home:eth0:none"
ERROR    Error validating install location: Could not find an installable distribution at 'http://archive.ubuntu.com/ubuntu/dists/bionic/main/binary-amd64/'

The location must be the root directory of an install tree.
See virt-install man page for various distro examples.

이 명령의 대부분은 주로 다음을 사용하여 조립했습니다.이 가이드약간의 추가 참조를 통해이 예제 모음(구체적으로 링크된 섹션) 및이 유용한 RedHat 문서, 첫 번째 기사의 작성자와 직접 메시지를 교환했습니다.

그러나 위의 명령을 실행하면 도움이 되지 않는 일반 오류를 볼 수 있습니다.

실망스러운 부분은 해당 URL이맨페이지에서 직접virt-install--location인수 정의 에서 :

-l, --location OPTIONS
   Distribution tree installation source. virt-install can recognize certain distribution trees and fetches a bootable kernel/initrd pair to
   launch the install.

   --location allows things like --extra-args for kernel arguments, and using --initrd-inject. If you want to use those options with CDROM media,
   you can pass the ISO to --location as well which works for some, but not all, CDROM media.

   The "LOCATION" can take one of the following forms:

   https://host/path
       An HTTP server location containing an installable distribution image.

   ftp://host/path
       An FTP server location containing an installable distribution image.

   ISO Probe the ISO and extract files using 'isoinfo'

   DIRECTORY
       Path to a local directory containing an installable distribution image. Note that the directory will not be accessible by the guest after
       initial boot, so the OS installer will need another way to access the rest of the install media.

   Some distro specific url samples:

   Fedora/Red Hat Based
       https://download.fedoraproject.org/pub/fedora/linux/releases/29/Server/x86_64/os

   Debian
       https://ftp.us.debian.org/debian/dists/stable/main/installer-amd64/

   Ubuntu
       https://us.archive.ubuntu.com/ubuntu/dists/wily/main/installer-amd64/

   Suse
       https://download.opensuse.org/pub/opensuse/distribution/leap/42.3/repo/oss/

   Additionally, --location can take 'kernel' and 'initrd' sub options. These paths relative to the specified location URL/ISO that allow
   selecting specific files for kernel/initrd within the install tree. This can be useful if virt-install/ libosinfo doesn't know where to find
   the kernel in the specified --location.

   For example, if you have an ISO that libosinfo doesn't know about called my-unknown.iso, with a kernel at 'kernel/fookernel' and initrd at
   'kernel/fooinitrd', you can make this work with:

     --location my-unknown.iso,kernel=kernel/fookernel,initrd=kernel/fooinitrd

문제 명령의 여러 변형을 시도했습니다.

이전에 이와 동일한 오류가 발생했으며 어떻게 해결했는지 기억할 수 없는 친구의 모든 제안입니다.

ISO 시도로 인해 다음과 같은 마지막 몇 줄이 표시되었습니다.보였다초기 성공과 같습니다.

mount: mounting /root/cdrom/casper/extras/modules.squashfs-generic on /root/lib/modules failed: No such file or directory
mount: mounting /dev on /root/dev failed: No such file or directory
[a few more of these]
run-init: current directory on the same filesystem as the root: error 0
Target filesystem doesn't have requested /sbin/init.
[more run-init errors]
No init found. Try passing init= bootarg.


BusyBox v1.27.2 (Ubuntu 1:1.27.2-2ubuntu3.3) built-in shell (ash)
Enter 'help' for a list of built-in commands.

(initramfs)

이 문제를 해결하기에는 제 능력으로는 아직 한계가 있으며 VM을 실행하려면 도움이 절실히 필요합니다.

내가 달성하려는 VM 설정은 다음과 같습니다.

  • 경로의 VM/dragonode/dragonode.qcow2
  • VM OS: Ubuntu 18.04 LTS, 그래픽 없음
  • VM의 가상 네트워크 인터페이스를 다음에 바인딩합니다.br0
  • 즉시 SSH를 통해 연결할 수 있도록 IP 주소 192.168.1.144를 제공하세요.
  • 나머지는 원래 명령에서 자체적으로 설명되어야 합니다.

답변1

나는 단지virt-install에 대한 Ubuntu Serverguide 섹션참고로. 또한 VNC를 통해 실제 설치를 수행하려면 그래픽이 필요합니다. iso가 이미 다운로드되고 현재 디렉터리에 있는 ISO 방법을 사용하면 다음과 같은 명령이 제안됩니다(호스트 네트워크 DHCP에서 IP 주소를 얻을 수 있다고 가정).

virt-install --name dragonode --ram 2048 \
--disk path=/dragonode/dragonode.img,bus=virtio,size=50 \
-c ubuntu-18.04.6-live-server-amd64.iso \
--network bridge=br0,model=virtio \
--video=vmvga --graphics vnc,listen=0.0.0.0 --noautoconsole -v --vcpus=1

관련 정보