You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 26, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Apr 26, 2026. It is now read-only.
How would I install 'virt-bootstrap' on Ubuntu 18.04? #2
I'm using virt-manager on Ubuntu 18.04, and I specified in the virt-manager UI to create a new Libvirt-LXC virtual machine that is an operating system container. The UI then asks me to provide an existing OS root directory, but also implies that such a directory can be created with the message "To enable OS directory tree creation, please install virt-bootstrap".
I could not find a .deb package for this project, so I suppose it would be done manually, or perhaps by installing another package that includes it? What would be the procedure to install this software on Ubuntu 18.04 and configuring it so that virt-manager could use it?
Thanks @rst0git , the installation procedure worked after I also did apt install python-setuptools python-passlib python-guestfs for the Python dependencies.
libvirt-sandbox-init-qemu: mount_9pfs: cannot mount sandbox:root on /tmproot (9p): Invalid argument
shows that the mount syscall failed to mount 9p filesystem.
To fix it, try to:
modprobe 9pnet
modprobe 9pnet_virtio
Or you can run virt-manager/virt-bootstrap as root. This will make virt-bootstrap use LXC driver of libvirt instead of qemu-session when extracting the rootfs of the contianer image.
Same error even after loading those modules and verifying that they are loaded. I run libvirt as my local user so that it can interface with pulseaudio, could that be the problem?
username@PC:~/Downloads/virt-bootstrap-master/src/virtBootstrap$ sudo python virt_bootstrap.py docker://ubuntu:latest /home/dino/Downloads/ubuntu-rootfs
INFO : Checking cached layers
INFO : Downloading container image
Traceback (most recent call last):
File "virt_bootstrap.py", line 350, in
sys.exit(main())
File "virt_bootstrap.py", line 338, in main
progress_cb=args.status_only)
File "virt_bootstrap.py", line 152, in bootstrap
progress=prog).unpack(dest)
File "/usr/local/lib/python2.7/dist-packages/virtBootstrap/sources/docker_source.py", line 301, in unpack
self.fetch_layers()
File "/usr/local/lib/python2.7/dist-packages/virtBootstrap/sources/docker_source.py", line 289, in fetch_layers
self.download_image()
File "/usr/local/lib/python2.7/dist-packages/virtBootstrap/sources/docker_source.py", line 153, in download_image
self.read_skopeo_progress(skopeo_copy)
File "/usr/local/lib/python2.7/dist-packages/virtBootstrap/sources/docker_source.py", line 259, in read_skopeo_progress
raise subprocess.CalledProcessError(proc.returncode, ' '.join(cmd))
subprocess.CalledProcessError: Command 'skopeo copy docker://ubuntu:latest dir:/tmp/tmpP83wgwvirt-bootstrap' returned non-zero exit status 1
And then I executed the command sudo python virt_bootstrap.py docker://ubuntu:latest /home/dino/Downloads/ubuntu-rootfs
The output of the above command is shown below. Could you please help me to resolve this error?
dino@Dinesh-PC:~/Downloads/virt-bootstrap-master/src/virtBootstrap$ sudo python virt_bootstrap.py docker://ubuntu:latest /home/dino/Downloads/ubuntu-rootfs
INFO : Checking cached layers
INFO : Extracting container layers
INFO : Extracting layer (1/4) with size: 30.87 MiB
Traceback (most recent call last):
File "virt_bootstrap.py", line 350, in
sys.exit(main())
File "virt_bootstrap.py", line 338, in main
progress_cb=args.status_only)
File "virt_bootstrap.py", line 152, in bootstrap
progress=prog).unpack(dest)
File "/usr/local/lib/python2.7/dist-packages/virtBootstrap/sources/docker_source.py", line 307, in unpack
utils.untar_layers(self.layers, dest, self.progress)
File "/usr/local/lib/python2.7/dist-packages/virtBootstrap/utils.py", line 344, in untar_layers
safe_untar(tar_file, dest_dir)
File "/usr/local/lib/python2.7/dist-packages/virtBootstrap/utils.py", line 287, in safe_untar
execute(virt_sandbox + params)
File "/usr/local/lib/python2.7/dist-packages/virtBootstrap/utils.py", line 254, in execute
stderr=subprocess.PIPE
File "/usr/lib/python2.7/subprocess.py", line 394, in init
errread, errwrite)
File "/usr/lib/python2.7/subprocess.py", line 1047, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory
Thank you and sorry for bothering you. I realised that I have to delete ubuntu. Installed fedora. Followed all the steps mentioned above including #2 (comment)
So, I have tried to run program using root, but, this error showed up:
[root@localhost virtBootstrap]# sudo python virt_bootstrap.py docker://ubuntu:latest /home/dino/Downloads/ubuntu-rootfs
INFO : Checking cached layers
INFO : Extracting container layers
INFO : Extracting layer (1/4) with size: 30.87 MiB
Traceback (most recent call last):
File "virt_bootstrap.py", line 350, in
sys.exit(main())
File "virt_bootstrap.py", line 338, in main
progress_cb=args.status_only)
File "virt_bootstrap.py", line 152, in bootstrap
progress=prog).unpack(dest)
File "/usr/lib/python2.7/site-packages/virtBootstrap/sources/docker_source.py", line 307, in unpack
utils.untar_layers(self.layers, dest, self.progress)
File "/usr/lib/python2.7/site-packages/virtBootstrap/utils.py", line 344, in untar_layers
safe_untar(tar_file, dest_dir)
File "/usr/lib/python2.7/site-packages/virtBootstrap/utils.py", line 287, in safe_untar
execute(virt_sandbox + params)
File "/usr/lib/python2.7/site-packages/virtBootstrap/utils.py", line 264, in execute
raise subprocess.CalledProcessError(proc.returncode, cmd_str)
subprocess.CalledProcessError: Command 'virt-sandbox -c lxc:/// --name=bootstrap_7997 -m host-bind:/mnt=/home/dino/Downloads/ubuntu-rootfs -- /bin/tar xf /var/cache/virt-bootstrap/docker_images/6cf436f81810f067c6d4ffca6793eae7cb6d38456715b0707d8a5a2d1acccf12 -C /mnt --exclude dev/* --overwrite --absolute-names --acls --xattrs --selinux' returned non-zero exit status 1
Activity
rst0git commentedon Jul 16, 2018
Hi Marat,
virt-bootstrap does not have a debian package yet, but you can install it using the following steps:
Note that virt-bootstrap has the following dependencies:
libvirt,libvirt-sandbox,skopeo,python-guestfs,python-passlibmaratbn commentedon Jul 19, 2018
Thanks @rst0git , the installation procedure worked after I also did
apt install python-setuptools python-passlib python-guestfsfor the Python dependencies.Queuecumber commentedon Jul 23, 2018
But you still need to do a lot to actually make it functional. For example, skopeo I had to get from this ppa or I had an error.
Now I am getting the following error from virt-manager when trying to run
docker://docker.io/ubuntu:18.04as a testany idea what I'm missing here?
rst0git commentedon Jul 23, 2018
Hi @Queuecumber,
The error message:
shows that the
mountsyscall failed to mount 9p filesystem.To fix it, try to:
Or you can run virt-manager/virt-bootstrap as root. This will make virt-bootstrap use LXC driver of libvirt instead of qemu-session when extracting the rootfs of the contianer image.
Queuecumber commentedon Jul 23, 2018
Same error even after loading those modules and verifying that they are loaded. I run libvirt as my local user so that it can interface with pulseaudio, could that be the problem?
dinotumu commentedon Mar 2, 2019
Hey @rst0git @maratbn @Queuecumber @giuseppe @Antique
Can you please help me resolve this error?
username@PC:~/Downloads/virt-bootstrap-master/src/virtBootstrap$ sudo python virt_bootstrap.py docker://ubuntu:latest /home/dino/Downloads/ubuntu-rootfs
INFO : Checking cached layers
INFO : Downloading container image
Traceback (most recent call last):
File "virt_bootstrap.py", line 350, in
sys.exit(main())
File "virt_bootstrap.py", line 338, in main
progress_cb=args.status_only)
File "virt_bootstrap.py", line 152, in bootstrap
progress=prog).unpack(dest)
File "/usr/local/lib/python2.7/dist-packages/virtBootstrap/sources/docker_source.py", line 301, in unpack
self.fetch_layers()
File "/usr/local/lib/python2.7/dist-packages/virtBootstrap/sources/docker_source.py", line 289, in fetch_layers
self.download_image()
File "/usr/local/lib/python2.7/dist-packages/virtBootstrap/sources/docker_source.py", line 153, in download_image
self.read_skopeo_progress(skopeo_copy)
File "/usr/local/lib/python2.7/dist-packages/virtBootstrap/sources/docker_source.py", line 259, in read_skopeo_progress
raise subprocess.CalledProcessError(proc.returncode, ' '.join(cmd))
subprocess.CalledProcessError: Command 'skopeo copy docker://ubuntu:latest dir:/tmp/tmpP83wgwvirt-bootstrap' returned non-zero exit status 1
rst0git commentedon Mar 2, 2019
@dinoRkz What is the output of:
dinotumu commentedon Mar 2, 2019
Hey, thanks for replying. This is the output of the above commands after execution.
FATA[0000] Error loading trust policy: open /etc/containers/policy.json: no such file or directory
I tried to open the /etc/containers directory, but it does not exist.
dinotumu commentedon Mar 3, 2019
@rst0git Please have a look at podman-container-tools/skopeo#181
$ skopeo --insecure-policy copy docker://ubuntu:latest dir:/tmp/testI tried executing the above command, and it worked.
dinotumu commentedon Mar 3, 2019
I tried to do some alternative fix from here https://github.com/containers/skopeo/blob/master/default-policy.json
And then I executed the command
sudo python virt_bootstrap.py docker://ubuntu:latest /home/dino/Downloads/ubuntu-rootfsThe output of the above command is shown below. Could you please help me to resolve this error?
dino@Dinesh-PC:~/Downloads/virt-bootstrap-master/src/virtBootstrap$ sudo python virt_bootstrap.py docker://ubuntu:latest /home/dino/Downloads/ubuntu-rootfs
INFO : Checking cached layers
INFO : Extracting container layers
INFO : Extracting layer (1/4) with size: 30.87 MiB
Traceback (most recent call last):
File "virt_bootstrap.py", line 350, in
sys.exit(main())
File "virt_bootstrap.py", line 338, in main
progress_cb=args.status_only)
File "virt_bootstrap.py", line 152, in bootstrap
progress=prog).unpack(dest)
File "/usr/local/lib/python2.7/dist-packages/virtBootstrap/sources/docker_source.py", line 307, in unpack
utils.untar_layers(self.layers, dest, self.progress)
File "/usr/local/lib/python2.7/dist-packages/virtBootstrap/utils.py", line 344, in untar_layers
safe_untar(tar_file, dest_dir)
File "/usr/local/lib/python2.7/dist-packages/virtBootstrap/utils.py", line 287, in safe_untar
execute(virt_sandbox + params)
File "/usr/local/lib/python2.7/dist-packages/virtBootstrap/utils.py", line 254, in execute
stderr=subprocess.PIPE
File "/usr/lib/python2.7/subprocess.py", line 394, in init
errread, errwrite)
File "/usr/lib/python2.7/subprocess.py", line 1047, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory
rst0git commentedon Mar 3, 2019
Do you have
libvirt-sandboxinstalled?dinotumu commentedon Mar 3, 2019
Thank you and sorry for bothering you. I realised that I have to delete ubuntu. Installed fedora. Followed all the steps mentioned above including #2 (comment)
So, I have tried to run program using root, but, this error showed up:
[root@localhost virtBootstrap]# sudo python virt_bootstrap.py docker://ubuntu:latest /home/dino/Downloads/ubuntu-rootfs
INFO : Checking cached layers
INFO : Extracting container layers
INFO : Extracting layer (1/4) with size: 30.87 MiB
Traceback (most recent call last):
File "virt_bootstrap.py", line 350, in
sys.exit(main())
File "virt_bootstrap.py", line 338, in main
progress_cb=args.status_only)
File "virt_bootstrap.py", line 152, in bootstrap
progress=prog).unpack(dest)
File "/usr/lib/python2.7/site-packages/virtBootstrap/sources/docker_source.py", line 307, in unpack
utils.untar_layers(self.layers, dest, self.progress)
File "/usr/lib/python2.7/site-packages/virtBootstrap/utils.py", line 344, in untar_layers
safe_untar(tar_file, dest_dir)
File "/usr/lib/python2.7/site-packages/virtBootstrap/utils.py", line 287, in safe_untar
execute(virt_sandbox + params)
File "/usr/lib/python2.7/site-packages/virtBootstrap/utils.py", line 264, in execute
raise subprocess.CalledProcessError(proc.returncode, cmd_str)
subprocess.CalledProcessError: Command 'virt-sandbox -c lxc:/// --name=bootstrap_7997 -m host-bind:/mnt=/home/dino/Downloads/ubuntu-rootfs -- /bin/tar xf /var/cache/virt-bootstrap/docker_images/6cf436f81810f067c6d4ffca6793eae7cb6d38456715b0707d8a5a2d1acccf12 -C /mnt --exclude dev/* --overwrite --absolute-names --acls --xattrs --selinux' returned non-zero exit status 1
[root@localhost virtBootstrap]# virt-sandbox -c lxc:/// --name=bootstrap_7997 -m host-bind:/mnt=/home/dino/Downloads/ubuntu-rootfs -- /bin/tar xf /var/cache/virt-bootstrap/docker_images/6cf436f81810f067c6d4ffca6793eae7cb6d38456715b0707d8a5a2d1acccf12 -C /mnt --exclude dev/* --overwrite --absolute-names --acls --xattrs --selinux
2019-03-03 14:21:46.356+0000: 1: error : virCommandExec:2190 : cannot execute binary /etc/libvirt-sandbox/scratch/.libs/libvirt-sandbox-init-lxc: Permission denied
Failure in libvirt_lxc startup: cannot execute binary /etc/libvirt-sandbox/scratch/.libs/libvirt-sandbox-init-lxc: Permission denied
==============================================================================
EDIT: Screenshot of the output is here:
rst0git commentedon Mar 3, 2019
I think that the
Permission deniederror is caused by selinux, could you try withsetenforce 0?dinotumu commentedon Mar 4, 2019
Done!
Thanks for all your help. I hope this thread helps someone.
phrdina commentedon Apr 26, 2026
Closing this issue because this project is about to be archived.