Open Fashaun opened 2 years ago
Sorry, the vagrant package command is not support for now. (#4) I will give a step by step manual as soon as possible.
got it , thanks for the quick response
Sorry , but I mean how to vagrant up from an existing box on vagrant cloud Or , you mean I have to create my own local box first?
➜ test_debian vagrant init generic/debian10
A Vagrantfile
has been placed in this directory. You are now
ready to vagrant up
your first virtual environment! Please read
the comments in the Vagrantfile as well as documentation on
vagrantup.com
for more information on using Vagrant.
➜ test_debian vagrant up --provider=qemu
Bringing machine 'default' up with 'qemu' provider...
==> default: Checking if box 'generic/debian10' version '4.1.14' is up to date...
==> default: Importing a QEMU instance
default: Creating and registering the VM...
default: Successfully imported VM
==> default: Warning! The QEMU provider doesn't support any of the Vagrant
==> default: high-level network configurations (config.vm.network
). They
==> default: will be silently ignored.
==> default: Starting the instance...
==> default: Waiting for machine to boot. This may take a few minutes...
default: SSH address: 127.0.0.1:50022
default: SSH username: vagrant
default: SSH auth method: private key
Your way is the right way. You can use an existing box. There is more example in the Readme file and wiki. However, not all box works out of box..., the "generic/debian10" may need some fine tuning...
May I know how to fix it? then I could raise a merge request to you
Please try the same config in https://github.com/ppggff/vagrant-qemu/wiki/buster64-on-x86_64 It works on my macbook.
The basic steps to debug this problem:
ps -ef|grep qemu
, get the detail QEMU command and arguments-display none -vga none -daemonize
to get a display window)For this Debian issue, I didn't dig too much. It works after adding a VGA device. Maybe Debian needs a VGA device, or maybe there is another root cause. Please let me know if you find it. : )
Sorry but I'm the user use mac M1
Have you tried it?
Since your target box is a x86_64 box, it should work. (without qe.qemu_dir
config)
Is there a way to have vagrant-qemu emulate the libvirt provider for pre-existing boxes that require libvirt?
I'm trying to develop Mastodon on Apple M1 machine. Mastodon's Vagrantfile requires ubuntu/bionic64
image which uses the libvirt
provider. But VirtualBox does not work on Apple M1. Which leads to this error:
> vagrant up --provider qemu
Bringing machine 'default' up with 'qemu' provider...
==> default: Box 'ubuntu/bionic64' could not be found. Attempting to find and install...
default: Box Provider: libvirt
default: Box Version: >= 0
==> default: Loading metadata for box 'ubuntu/bionic64'
default: URL: https://vagrantcloud.com/ubuntu/bionic64
The box you're attempting to add doesn't support the provider
you requested. Please find an alternate box or use an alternate
provider. Double-check your requested provider to verify you didn't
simply misspell it.
If you're adding a box from HashiCorp's Vagrant Cloud, make sure the box is
released.
Name: ubuntu/bionic64
Address: https://vagrantcloud.com/ubuntu/bionic64
Requested provider: ["libvirt"]
This is even after I added the following section in the Vagrantfile as suggested by vagrant-qemu README:
config.vm.provider "qemu" do |qe|
qe.machine = "virt,accel=hvf,highmem=off"
qe.cpu = "cortex-a72"
end
I have filed an issue with Mastodon but on Apple M1, if vagrant-qemu emulates libvirt, then it would solve the problem for all projects with existing Vagrantfile that requires boxes with libvirt only.
I discovered that VirtualBox now has a Developer Preview build for Apple M1/M2 hosts. However, this doesn't actually work for me as the machine created by vagrant with ubuntu/bionic64 box gets aborted. Even if that were to be fixed, the performance will likely be terrible. These comments are explanatory:
Treat the M1 build as a very very early technical preview please, the Beta label is completely misleading and will be changed (this comes from the automated build system and aligns with the rest of the builds). There will be no official support for M1 with 7.0, not even for ARM virtualization, let alone x86 emulation on ARM.
And,
In a way the ARM64 package "slipped out", and it's not expected to work reliably. The implementation isn't complete yet (which is what you saw), and in top of that the performance is known to be extremely low. It isn't anywhere near production ready, we know. This will not change for VirtualBox 7, and the "Technology Preview" marker will stay for the foreseeable future, indicating that it won't be supported at all.
At best you'll get some really old 32-bit Linux to run to some degree, such as DSL 4.4.10. No chance even with Ubuntu 16.04 i386.
So, it would really be valuable for vagrant-qemu to support libvirt boxes like ubuntu/bionic64 because so many developers now use Apple M1/M2 machines.
JFYI, below is the packer HCL template to make an usable qcow2 image from the upstream Debian 11 arm64 genericcloud
image.
This is not a box but still can be used with the following config in Vagrantfile
:
vagrant_root = File.dirname(__FILE__)
config.vm.provider "qemu" do |qemu|
qemu.qemu_dir = "/opt/homebrew/share/qemu"
qemu.image_path = "#{vagrant_root}/deb11-arm64.qcow2"
end
It should be easy enough to adopt this approach to Ubuntu and other distros.
@nileshtrivedi I think the 'ubuntu/bionic64' only support virtualbox provider, see https://app.vagrantup.com/ubuntu/boxes/bionic64
There are some solutions:
Notes:
You might want to try https://app.vagrantup.com/perk/boxes/ubuntu-2204-arm64
Hello,
How could I create box for vagrant-qemu , for example debian OS?