-
Notifications
You must be signed in to change notification settings - Fork 35
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
can't force local IP #36
Comments
I tried with your config, it works with the correct ip.
You can you
|
I seem to encounter a similar issue 👀 I am using this example block from the README:
Startup log
However if I try to ping or SSH into it, it does not work: ping and ssh
vagrant ssh and ifconfig
Also the running qemu proccess looks fine to me: qemu-system proccess
System informationMachine: Mac M1 Pro Happy to provide additional infomation 😃 |
This is the expected behavior. The ip address in the configuration file (192.168.51.10) is the internal address of the virtual machine. It's works like behind a NAT network. The port 22 is mapped as 50022 on the host ( To get more information about network of qemu, https://wiki.qemu.org/Documentation/Networking, we use user network by default. Currently, this plugin doesn't support complex network config with vagrant gramma, but you can append qemu config to achieve same effect. What's your requirement? Maybe I could add more example or figure out new feature for that. |
Oh, thank you for clarifying. What I am trying to achieve is making the VM run on a specific IP within my private network so I can access it by connecting to that IP from my host machine. Is that somehow possible? EDIT: When using the virtualbox provider, I was able to achieve this by setting
However with this provider I discarded this due to the following warning during the startup log:
|
Hi this is the output of ps aux | grep qemu. it seems the net=192.168.51.0/24,dhcpstart=192.168.51.10 part is not there for some reason. /opt/homebrew/bin/qemu-system-aarch64 -machine virt,accel=hvf,highmem=on -cpu host -smp 2 -m 2G -device virtio-net-device,netdev=net0 -netdev user,id=net0,hostfwd=tcp::50022-:22 -drive if=virtio,format=qcow2,file=/Users//Tmp/vagrant/.vagrant/machines/controlplane/qemu/88gicSkM6KE/linked-box.img -drive if=pflash,format=raw,file=/Users//Tmp/vagrant/.vagrant/machines/controlplane/qemu/88gicSkM6KE/edk2-aarch64-code.fd,readonly=on -drive if=pflash,format=raw,file=/Users//Tmp/vagrant/.vagrant/machines/controlplane/qemu/88gicSkM6KE/edk2-arm-vars.fd -chardev socket,id=mon0,path=/Users//.vagrant.d/tmp/vagrant-qemu/88gicSkM6KE/qemu_socket,server=on,wait=off -mon chardev=mon0,mode=readline -chardev socket,id=ser0,path=/Users//.vagrant.d/tmp/vagrant-qemu/88gicSkM6KE/qemu_socket_serial,server=on,wait=off -serial chardev:ser0 -pidfile /Users//Tmp/vagrant/.vagrant/machines/controlplane/qemu/88gicSkM6KE/qemu.pid -parallel null -monitor none -display none -vga none -daemonize |
As I see from my previous comment for some reason qemu won't accept the arguments for the private IP. Any ideas please? |
@UriZafrir What version of the plugin do you use? And please try a full restart? |
@ppggff found I was using 0.19. updated to 0.3.4. now working! thanks so much :)) |
another question please. So now I am trying to create a TAP network:
I would appreciate your assistance. this is the error I am getting: Command: ["qemu-system-aarch64", "-machine", "virt,accel=hvf,highmem=on", "-cpu", "host", "-smp", "2", "-m", "2G", "-device", "e1000,netdev=net0", "-netdev", "user,id=net0,hostfwd=tcp::50022-:22,net=192.168.51.0/24,dhcpstart=192.168.51.3", "-drive", "if=ide,format=qcow2,file=/Users/urizafrir/Tmp/vagrant/.vagrant/machines/vm-3/qemu/_0-vRG5wfuI/linked-box.img", "-drive", "if=pflash,format=raw,file=/Users/urizafrir/Tmp/vagrant/.vagrant/machines/vm-3/qemu/_0-vRG5wfuI/edk2-aarch64-code.fd,readonly=on", "-drive", "if=pflash,format=raw,file=/Users/urizafrir/Tmp/vagrant/.vagrant/machines/vm-3/qemu/_0-vRG5wfuI/edk2-arm-vars.fd", "-chardev", "socket,id=mon0,path=/Users/urizafrir/.vagrant.d/tmp/vagrant-qemu/_0-vRG5wfuI/qemu_socket,server=on,wait=off", "-mon", "chardev=mon0,mode=readline", "-chardev", "socket,id=ser0,path=/Users/urizafrir/.vagrant.d/tmp/vagrant-qemu/_0-vRG5wfuI/qemu_socket_serial,server=on,wait=off", "-serial", "chardev:ser0", "-pidfile", "/Users/urizafrir/Tmp/vagrant/.vagrant/machines/vm-3/qemu/_0-vRG5wfuI/qemu.pid", "-parallel", "null", "-monitor", "none", "-display", "none", "-vga", "none", "-daemonize", {:notify=>[:stdout, :stderr, :stdin]}] Stderr: qemu-system-aarch64: -netdev user,id=net0,hostfwd=tcp::50022-:22,net=192.168.51.0/24,dhcpstart=192.168.51.3: DHCP must be different from host and DNS |
see #40 for future develop of private network |
@ppggff Is there is way to have two network card's configured on the vm.
Whenever I try to add a network via vagrant file, it overrides the eth0 and configures the 192.168.x.x range.
Also, if you notice the SMB configuration also doesn't work and results in the 1
I think the thread is here for this conversation - #40 |
@smitjainsj yes, you can:
Some notes about network in qemu:
For the vmnet config #40, I will try to give a workable vagrant config with About the SMB error, please try the vagrant doc https://developer.hashicorp.com/vagrant/docs/synced-folders/smb |
Hi all
I am having the same issue as #33 but the solution offered isn't working for me.
this is my vagrantfile:
but the vms get the ip 127.0.0.1 when booting, 10.0.2.15 when typing ifconfig.
I had to change the ssh port.
Can anyone please assist?
The text was updated successfully, but these errors were encountered: