Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support running virtme-ng instances inside docker #51

Closed
arighi opened this issue Dec 20, 2023 · 1 comment
Closed

support running virtme-ng instances inside docker #51

arighi opened this issue Dec 20, 2023 · 1 comment
Assignees

Comments

@arighi
Copy link
Owner

arighi commented Dec 20, 2023

Theoretically we should be able to run vng instances inside docker, but apparently there are problems running non-interactive sessions.

The problem seems to be related to the fact that virtio-serial devices (used by virtme-ng to connect stdin/stdout/stderr between host and guest) are not created properly, potentially due to some limitations of the /dev inside docker.

Investigate more on this and see if we can find a proper fix.

@arighi arighi self-assigned this Dec 20, 2023
arighi added a commit to arighi/virtme-ng-init that referenced this issue Dec 21, 2023
Minor changes required to run virtme-ng instances inside docker
containers.

Link: arighi/virtme-ng#51
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
arighi added a commit that referenced this issue Dec 21, 2023
Hide virtiofsd warnings that may confuse users, unless we are running in
verbose mode.

This fixes issue #51.

Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
arighi added a commit that referenced this issue Dec 21, 2023
Do not enable microvm or native kvm acceleration if /dev/kvm does not
exist.

This may happen in container environments, despite running on a native
architecture, but not having access to /dev/kvm may result in permission
errors.

This fixes issue #51.

Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
arighi added a commit that referenced this issue Dec 21, 2023
Minor changes to our virtme-init script required to run virtme-ng
instances inside docker containers.

This fixes issue #51.

Link: arighi/virtme-ng-init@6ed126b
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
arighi added a commit that referenced this issue Dec 21, 2023
Resync virtme-ng-init to apply the equivalent changes of commit
b25a203 ("virtme-init: docker host support") also to virtme-ng-init.

This fixes issue #51.

Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
arighi added a commit that referenced this issue Dec 21, 2023
When running virtme-ng instances inside docker containers we may not
have a proper udev support on the host.

As a result the communication over virtio-serial port may not work
properly.

This can be solved by running the following command on the host (as
root), before starting the virtme-ng instances:

  # udevadm trigger --subsystem-match --action=change

Considering that we typicall run vng as root inside docker this can help
to automatically solve potential issues in this scenario.

This fixes issue #51.

Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
arighi added a commit that referenced this issue Dec 21, 2023
Add a note to the troubleshooting section about running virtme-ng
instances inside docker.

This should be automatically solved by virtme-ng itself, with commit
48b77f8 ("virtme: kick udev when running as root"), but the
troubleshooting note may still be helpful in some cases (e.g., when not
using the latest version of virtme-ng).

This fixes issue #51.

Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
@arighi arighi mentioned this issue Dec 21, 2023
arighi added a commit that referenced this issue Dec 21, 2023
Add an example on how to use virtme-ng inside a docker container with an
ubuntu-22.04 image.

Moreover, add a note to the troubleshooting section, mentioning about
the udev requirement to properly support stdin/stdout/stderr
redirection with virtme-ng instances running inside docker.

This fixes issue #51.

Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
arighi added a commit that referenced this issue Dec 21, 2023
Add an example on how to use virtme-ng inside a docker container with an
ubuntu-22.04 image.

Moreover, add a note to the troubleshooting section, mentioning about
the udev requirement to properly support stdin/stdout/stderr
redirection with virtme-ng instances running inside docker.

This fixes issue #51.

Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
arighi added a commit that referenced this issue Dec 21, 2023
Do not enable microvm or native kvm acceleration if /dev/kvm does not
exist (or if we don't have permissions to use it).

This may happen in container environments, despite running on a native
architecture, but not having access to /dev/kvm may result in EPERM
errors and warnings that may confuse users.

This fixes issue #51.

Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
arighi added a commit that referenced this issue Dec 21, 2023
Minor changes to our virtme-init script required to run virtme-ng
instances inside docker containers.

This fixes issue #51.

Link: arighi/virtme-ng-init@6ed126b
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
arighi added a commit that referenced this issue Dec 21, 2023
Resync virtme-ng-init to apply the equivalent changes of commit
b25a203 ("virtme-init: docker host support") also to virtme-ng-init.

This fixes issue #51.

Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
arighi added a commit that referenced this issue Dec 21, 2023
Add an example on how to use virtme-ng inside a docker container with an
ubuntu-22.04 image.

Moreover, add a note to the troubleshooting section, mentioning about
the udev requirement to properly support stdin/stdout/stderr
redirection with virtme-ng instances running inside docker.

This fixes issue #51.

Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
@arighi
Copy link
Owner Author

arighi commented Dec 21, 2023

Fixed by PR #52

@arighi arighi closed this as completed Dec 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant