KVM 가상 머신 내부에서 VirtualBox를 사용하기 위해 중첩된 가상화를 활성화하는 방법은 무엇입니까?

KVM 가상 머신 내부에서 VirtualBox를 사용하기 위해 중첩된 가상화를 활성화하는 방법은 무엇입니까?

우리는 중첩된 VirtualBox 하이퍼바이저( )로 사용하려는 가상 머신을 실행하는 KVM 하이퍼바이저( L0, AMD, 커널: )를 가지고 있습니다 . 그래서 제가 하려는 것은 KVM 내부에서 VirtualBox를 실행하는 것입니다. KVM 하이퍼바이저에 대한 일부 세부정보( ):Linux level0kvmhypervisor 4.19.0-12-amd64 #1 SMP Debian 4.19.152-1 (2020-10-18) x86_64 GNU/LinuxL1L0

# cat /proc/cpuinfo
processor       : 0 ... 23
vendor_id       : AuthenticAMD
cpu family      : 23
model           : 113
model name      : AMD Ryzen 9 3900 12-Core Processor
stepping        : 0
microcode       : 0x8701021
cpu MHz         : 2193.155
cache size      : 512 KB
physical id     : 0
siblings        : 24
core id         : 0
cpu cores       : 12
apicid          : 0
initial apicid  : 0
fpu             : yes
fpu_exception   : yes
cpuid level     : 16
wp              : yes
flags           : ... svm ...
bugs            : sysret_ss_attrs spectre_v1 spectre_v2 spec_store_bypass
bogomips        : 6188.58
TLB size        : 3072 4K pages
clflush size    : 64
cache_alignment : 64
address sizes   : 43 bits physical, 48 bits virtual
power management: ts ttp tm hwpstate cpb eff_freq_ro [13] [14]
# dpkg --list | egrep -- "(kvm|libvirt)" | sed 's/amd64.*//g'
ii  libsys-virt-perl                     5.0.0-1                             
ii  libvirt-clients                      5.0.0-4+deb10u1                     
ii  libvirt-daemon                       5.0.0-4+deb10u1                     
ii  libvirt-daemon-system                5.0.0-4+deb10u1                     
ii  libvirt-glib-1.0-0:
ii  libvirt0:
ii  python3-libvirt                      5.0.0-1                             
ii  qemu-kvm                             1:3.1+dfsg-8+deb10u8

중첩 옵션도 활성화됩니다.

# cat /sys/module/kvm_amd/parameters/nested 
1

VirtualBox가 설치된 KVM 가상 머신 내부(L1): Vagrant로 생성된 VM을 시작하려고 하는데 다음 오류 메시지가 나타납니다.

...
==> default: Booting VM...
There was an error while executing `VBoxManage`, a CLI used by Vagrant
for controlling VirtualBox. The command and stderr is shown below.
Command: ["startvm", "357a07b4-7d81-4336-9ea6-0dbf0ab49d18", "--type", "headless"]                                                                 
Stderr: VBoxManage: error: AMD-V is not available (VERR_SVM_NO_SVM)
VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component ConsoleWrap, interface IConsole

VirtualBox 하이퍼바이저에 대한 KVM XML CPU 설정은 다음과 같습니다 L1.

<vcpu placement='static'>1</vcpu>
<cpu mode='host-model' check='partial'>
  <model fallback='allow'/>
</cpu>

나는 여기서 뭔가가 바뀌어야 한다고 생각하지만, 무엇인지는 잘 모르겠습니다. 해당 주제에 대한 자료를 찾을 수 없어서 여기에 질문합니다. L1VM을 시작하기 위해 KVM 가상 머신 내에서 VirtualBox 하이퍼바이저()를 실행하려면 어떻게 해야 합니까 ?

어떤 도움이라도 주시면 감사하겠습니다.

답변1

<cpu mode='host-passthrough'>
    <feature policy='require' name='svm'/>
</cpu>

가상 머신 설정 파일에서 AMD CPU에 대해 이러한 설정을 사용하십시오.

관련 정보