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

Vagrant cann't assign a statick ip to the guest system. #9207

Closed
greister opened this issue Nov 21, 2017 · 6 comments
Closed

Vagrant cann't assign a statick ip to the guest system. #9207

greister opened this issue Nov 21, 2017 · 6 comments

Comments

@greister
Copy link

Vagrant version

vagrant -v
Vagrant 2.0.1

Host operating system

Windows 10 ver:1709

Guest operating system

Boxfile:
mloskot/manjaro-i3-17.0-minimal

Vagrantfile

Vagrant.configure("2") do |config|
  # The most common configuration options are documented and commented below.
  # For a complete reference, please see the online documentation at
  # https://docs.vagrantup.com.

  # Every Vagrant development environment requires a box. You can search for
  # boxes at https://atlas.hashicorp.com/search.
  config.vm.box = "mloskot/manjaro-i3-17.0-minimal"
  config.vbguest.auto_update = false

  # Disable automatic box update checking. If you disable this, then
  # boxes will only be checked for updates when the user runs
  # `vagrant box outdated`. This is not recommended.
  # config.vm.box_check_update = false

  # Create a forwarded port mapping which allows access to a specific port
  # within the machine from a port on the host machine. In the example below,
  # accessing "localhost:8080" will access port 80 on the guest machine.
  # NOTE: This will enable public access to the opened port
  # config.vm.network "forwarded_port", guest: 80, host: 8080

  # Create a forwarded port mapping which allows access to a specific port
  # within the machine from a port on the host machine and only allow access
  # via 127.0.0.1 to disable public access
  # config.vm.network "forwarded_port", guest: 80, host: 8080, host_ip: "127.0.0.1"
  #	config.vm.network  "forwarded_port", guest: 22, host: 2270, host_ip: "127.0.0.1"
  # Create a private network, which allows host-only access to the machine
  # using a specific IP.
  # config.vm.network "private_network", ip: "192.168.33.10"

  # Create a public network, which generally matched to bridged network.
  # Bridged networks make the machine appear as another physical device on
  # your network.
   config.vm.network "private_network", ip: "192.168.33.10" , auto_config: false
   config.vm.network  "public_network", type: "dhcp", auto_config: false , use_dhcp_assigned_default_route: true
   config.ssh.username = "vagrant"
   config.ssh.password = "vagrant"
   config.vm.synced_folder "./data", "/vagrant"
   config.vm.provision "shell", 
		run: "always", 
		inline: "ifconfig enp0s8 192.168.33.10 netmask 255.255.255.0 up"
	
	config.vm.provision "shell",
        run: "always",
        inline: "eval `route -n | awk '{ if ($8 == \"eth0\" && $2 != \"0.0.0.0\") print \"route del default gw \" $2; }'`"
  

  # Share an additional folder to the guest VM. The first argument is
  # the path on the host to the actual folder. The second argument is
  # the path on the guest to mount the folder. And the optional third
  # argument is a set of non-required options.
   
   
	# config.vm.synced_folder "d:/vagrant/manjaro/data", "/vagrant" ,
	 # owner: "vagrant",
     # group: "www-data",
    # mount_options: ["dmode=775,fmode=664"]

  # Provider-specific configuration so you can fine-tune various
  # backing providers for Vagrant. These expose provider-specific options.
  # Example for VirtualBox:
  #
  # config.vm.provider "virtualbox" do |vb|
  #   # Display the VirtualBox GUI when booting the machine
  #   vb.gui = true
  #
  #   # Customize the amount of memory on the VM:
  #   vb.memory = "1024"
  # end
  #
  # View the documentation for the provider you are using for more
  # information on available options.



end

Please note, if you are using Homestead or a different Vagrantfile format, we
may be unable to assist with your issue. Try to reproduce the issue using a
vanilla Vagrantfile first.

Debug output

logurl: https://gist.github.com/greister/95e5c1da35fa884a0fa0de971b0747e7

Expected behavior

What should have happened?

Actual behavior

What actually happened?

Steps to reproduce

References

Are there any other GitHub issues (open or closed) that should be linked here?
For example:

@martinandersson
Copy link

martinandersson commented Dec 3, 2017

Yeah same here. I wasn't even using the box listed in the issue tracker above, I created a new box based on Manjaro 17.1-rc2. Released as pristine/manjaro-budgie-17.

It is said over here that installing net-tools (sudo pacman -S net-tools) could solve the problem, but that didn't work for me.

@martinandersson
Copy link

..and one more thing. If I set a custom hostname in the Vagrantfile, then this will actually crash the desktop environment on my VM lol. I can't even get a terminal to open. But after a restart, both the desktop works and I can verify the new hostname.

@greister
Copy link
Author

@martinanderssondotcom ,I installed your box ,has the problem. How to resolve it?

@martinandersson
Copy link

Don't use Manjaro lol. Manjaro and specifically, Pacman, is underdocumented and confusing in so many aspects. You might wanna look at pristine/ubuntu-budgie-17-x64 instead.

@soapy1
Copy link
Contributor

soapy1 commented Apr 17, 2020

This sounds like a reasonable idea, but this has low chance of being a priority for us anytime soon, so we'd rather close this issue than have it stagnate into the foreseeable future. The best way to get this implemented would be to submit a PR to add a Manjaro guest. If you do so, we'd welcome this work. If you want to discuss how to go about doing this, I'd be happy to help with that.

Again, thank you for suggesting this and it is a reasonable idea. But, since this is a feature request, it requires some work to add it to the project and we don't plan on doing that soon. But as this is also an open source project we welcome contributions. Thanks!

@soapy1 soapy1 closed this as completed Apr 17, 2020
@ghost
Copy link

ghost commented May 18, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators May 18, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants