sonic-net / sonic-buildimage

Scripts which perform an installable binary image build for SONiC
Other
739 stars 1.43k forks source link

sonic-vs image virsh: Failed to create domain from sonic.xml #7814

Open chrispsommers opened 3 years ago

chrispsommers commented 3 years ago

Description

Attempting to create a VM using virsh per https://github.com/Azure/sonic-buildimage/blob/master/platform/vs/README.vsvm.md fails. I am using an Ubuntu 16.04 VM inside VirtualBox to build and run.

Steps to reproduce the issue:

  1. make configure PLATFORM=vs
  2. make all
  3. gunziped /target/sonic-vs.img.gz and copied to /data/sonic/sonic-buildimage/target/sonic-vs.img
  4. cd platform/vs
  5. sudo virsh
  6. virsh # create sonic.xml

Describe the results you received:

virsh # create sonic.xml
error: Failed to create domain from sonic.xml
error: internal error: early end of file from monitor, possible problem: 2021-06-07T23:29:51.208570Z qemu-system-x86_64: -netdev tap,id=hostnet1: could not configure /dev/net/tun: Operation not permitted

Describe the results you expected:

Successfully spawn VM.

Output of show version:

n/a

Output of show techsupport:

n/a

Additional information you deem important (e.g. issue happens only occasionally):

Using an Ubuntu 16.04 VM running inside VirtualBox on an Ubuntu 20.04 host. I have enabled nested virtualization. In addition I've disabled apparmor in the attempt to relax security settings.

Is it a supported use-case to build and run sonic-vs inside a VM?

zhangyanzhao commented 3 years ago

@chrispsommers can you please try on a host directly?

lguohan commented 3 years ago

can you create any vm inside this 16.04 vm to see if it is supported or not? this seems not related to sonic.

chrispsommers commented 3 years ago

@zhangyanzhao It's not immediately convenient to do this but I'll try at some point, thanks. @lguohan Good suggestion, I'll try when I get a chance