Network configuration with Slackware box

299 views
Skip to first unread message

Olivier Meurice

unread,
Nov 9, 2015, 3:42:57 AM11/9/15
to Vagrant

I tried to configure a private network with Slackware boxes but I did get into trouble. I get the same error with a box (ricardson/slackware64-14.1-minimal) from the Atlas catalog and with a box I created from scratch. I am using Vagrant 1.7.4 and VirtualBox 4.2.24.

The error message is the following:

Configuring and enabling network interfaces... Vagrant attempted to execute the capability 'configure_networks' on the detect guest OS 'linux', but the guest doesn't support that capability. This capability is required for your configuration of Vagrant. Please either reconfigure Vagrant to avoid this capability or fix the issue by creating the capability.

This error occurs when adding a vm.network with "private_network" attribute. Port forwarding does not cause any problem.

I haven't find the reason of this problem yet but it seems clear that is it related to the box itself. Slackware seems to be missing something. I can switch to another box but I would be very interested to understand that issue. Any help would be appreciated.

Alvaro Miranda Aguilera

unread,
Nov 9, 2015, 5:01:34 AM11/9/15
to vagra...@googlegroups.com
Hello,

Let me start with what works:


Vagrant.configure(2) do |config|
config.vm.box = "ricardson/slackware64-14.1-minimal"
config.vm.synced_folder ".", "/vagrant", disabled: true
config.vm.network "private_network", type: "dhcp", auto_config: false
config.vm .provision "shell", run: "always", inline: "/sbin/dhcpcd eth1"
end

I did disable the shared folder since seems that box doesn't have the
Vbox guest additions.


eth1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 172.28.128.3 netmask 255.255.255.0 broadcast 172.28.128.255

root@slack-minimal:~# route -n

Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 10.0.2.2 0.0.0.0 UG 202 0 0 eth0
10.0.2.0 0.0.0.0 255.255.255.0 U 202 0 0 eth0
10.0.2.15 127.0.0.1 255.255.255.255 UGH 202 0 0 lo
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo
172.28.128.0 0.0.0.0 255.255.255.0 U 203 0 0 eth1
172.28.128.3 127.0.0.1 255.255.255.255 UGH 203 0 0 lo
root@slack-minimal:~#


Looks good.



2 paths to get this done.

The short one, aka workaround.

1. Tell Vagrant to not configure the guest, and you use a shell script
with run: "always" that does the network for you.

If you will get a fixed ip, you can use ifconfig <something>
if you will get a dhcp, you can use /sbin/dhcpcd <interface>

the long one, aka get this fixed.

2.

Run the command vagrant up as

VAGRANT_LOG=debug vagrant up | tee vagrant_up_debug.log

and that will generate a log file that will tell you where/what is failing.

From there, based on the commands logic you found on 1, you can test
patch the code that is failing, and submit a Pull Request.

Hope this helps
Alvaro.
> --
> This mailing list is governed under the HashiCorp Community Guidelines -
> https://www.hashicorp.com/community-guidelines.html. Behavior in violation
> of those guidelines may result in your removal from this mailing list.
>
> GitHub Issues: https://github.com/mitchellh/vagrant/issues
> IRC: #vagrant on Freenode
> ---
> You received this message because you are subscribed to the Google Groups
> "Vagrant" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to vagrant-up+...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/vagrant-up/259a5991-2df3-46b1-90c2-d66413064104%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Olivier Meurice

unread,
Nov 9, 2015, 6:44:09 AM11/9/15
to Vagrant
Thanks a lot for your light speed answer Alvaro.
I already tested the workaround you suggests with success.
Additional info on how to get a log will be very useful too.


Olivier.

Alvaro Miranda Aguilera

unread,
Nov 10, 2015, 3:25:07 AM11/10/15
to vagra...@googlegroups.com
Hello Maurice.

the guest code lives here:

/opt/vagrant/embedded/gems/gems/vagrant-1.7.4/plugins/guests

There is an structure as you can see there is no slackware, and the
linux generic doesn't implement the network capabilty.

To see more in clear where the run it's failing you need to set a variable:

VAGRANT_LOG=debug

if you are in linux/osx or using a bash

you can do:

export VAGRANT_LOG=debug
vagrant up

or

VAGRANT_LOG=debug vagrant up

if you are in Windows:

set VAGRANT_LOG=debug
vagrant up

That will generate a bunch of logs that will tell you what Vagrant is doing.

As this is a new OS, and you would like to get this added to Vagrant.

have a look at /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/plugins/guests
and see how other OS are identified, and how they implement it.

feel free to ask here in the mailing list for help if you get stuck.

I wish I could do more, but I am not a Developer.

Good luck
alvaro.
> https://groups.google.com/d/msgid/vagrant-up/9358fe30-c560-47da-97d7-d4782c457fa0%40googlegroups.com.

Olivier Meurice

unread,
Nov 11, 2015, 11:23:03 AM11/11/15
to Vagrant
Hello Alvaro,

Your explanations helped me a lot, thanks!
I did get the sources from GitHub and added a Slackware plugin (vagrant/plugins/guests/slackware) and some template files for the network configuration files (vagrant\templates\guests/slackware) of the box.
But this is my very first Ruby project contribution and I don't know how to test my changes nor am I very familiar with Ruby ecosystem.
I have Ruby and the DevKit installed as explained on these projects web pages and I could run "bundle install", unfortunately I did not find any executable.
I read from the Vagrant GitHub page that I could run Vagrant from the source root folder with the command "bundle exec vagrant" but doing this Vagrant disables plugins (https://github.com/mitchellh/vagrant).
So could you please help me further for running my code changes and how I could easily debug it (may be helpful too ;)
One last thing: I have only a Windows 8 machine at my disposal at the moment and that's on it I try adding the plugin.

Thank you,
Olivier.

Olivier Meurice

unread,
Nov 13, 2015, 10:45:10 AM11/13/15
to Vagrant
Reply all
Reply to author
Forward
0 new messages