<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">Hello all,<div><br></div><div>I'm trying to run Android Studio under an lxc container. The emulator in Android Studio requires /dev/kvm support. I am passing access to this device through with:</div><div><br></div><div>  lxc.mount.entry = /dev/kvm dev/kvm none bind,create=file 0 0<br></div><div><div><br></div><div>And I also have:</div><div><br></div><div>  lxc.apparmor.profile = unconfined</div></div><div><br></div><div>Interestingly enough on the host I can do this:</div><div><div><br></div><div>  # cat /dev/kvm</div><div>  cat: /dev/kvm: Invalid argument</div></div><div><br></div><div>But on the container I get this:</div><div><br></div><div><div>  # cat /dev/kvm</div><div>  cat: /dev/kvm: Operation not permitted</div></div><div><br></div><div>No doubt because this is a device file that is owned by root and the container's notion of "root" is really some other, non-zero user ID.</div><div><br></div><div>My questions are: (1) Is it possible to grant an lxc container access to this device? (2) If so, what am I missing from the above? (3) Is it safe to do this?</div><div><br></div><div>I know it's not 100% safe the minute I start granting access to devices. But in this case I "trust" the Android SDK to the effect that it isn't a compromised binary. I don't know if I should trust it to not damage the host while trying to do its kvm thing. </div><div><br></div><div>Anyone have any luck with this? </div><div><br></div><div>Thanks in advance.</div><div><br></div><div>-M</div><div><br></div></div></div></div></div>