-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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 up
fails if the hostname needs to be changed on Alpine
#10584
Comments
An Alpine guest plugin sure would be nice. |
There is one, but it seems to have trouble setting the hostname anyway. You can probably submit a fix for network service not existing here This also could be an issue with this particular box. |
Not sure where to patch, and not much a Ruby programmer, but I thought some pseudo code might help someone else fix this issue. The above looks like shell logic, and if it is, I can update directly, if someone points me at the right file. In terms of how to fix this issue: First, If the file is missing (or perhaps it should work regardless of the previous step), Finally, it should check for the existence of the P.S. I noticed the logic checks for the existence of the |
@ladar Hi! I had asked about the explicit guest identification as ALT in a previous issue but I can seem to find it at the moment. Anyway, yes, there is an alpine plugin to provide guest caps, and this issue seems to be a box issue. This line: https://github.com/lavabit/robox/blob/master/tpl/generic-alpine35.rb#L35 results in the guest being identified incorrectly as ALT linux. With the vagrant-alpine plugin installed, and overriding the guest to alpine: Cheers! |
@chrisroberts much obliged for the fix. I didn't realize In the future, you're welcome to submit a pull request, you know, so you get credit for the legwork! |
@ladar Vagrant itself doesn't ship alpine guest support currently (just want to make sure there's no confusion here). The vagrant-alpine plugin provides the guest capabilities and needs to be installed for it to work correctly. And depending on how you want your boxes setup, you can require the plugin to be installed locally via the included Vagrantfile if you want (https://www.vagrantup.com/docs/vagrantfile/vagrant_settings.html#config-vagrant-plugins) |
@chrisroberts thank you for the clarification. I wasn't aware you could trigger the auto installation of a plugin via an embedded Vagrantfile. I ran an experiment and noticed that if I require the plugin the setup process gets halted with a prompt; which is a good thing for security. Is it possible for me to check whether the |
I should say, good for security, but sadly, it probably isn't the right solution for a base box, as it will break automated systems which rely on the image. |
Is there a reason why it would fallback to ALT linux and not just the default linux? And for automated systems, they can use this: https://www.vagrantup.com/docs/other/environmental-variables.html#vagrant_install_local_plugins |
It seems I was only dictating and
What I meant, is that if I were to release an Alpine robox which required the Even if that weren't the case, I try not release robox builds which fail/error/complain to work "out of the box", if I can help it (ie know about an issue and can find a workaround). But setting the guest agent type to |
Just a side note on Vagrantfile usage: https://github.com/lavabit/robox/blob/master/tpl/generic-alpine35.rb#L35 This isn't setting the guest to override.vm.guest = :alt |
@chrisroberts thank you! My Unfortunately I'm already in the middle of a With any luck, I'll remember to actually test it out before I release the images! I'd like to also run a test and see if the |
@chrisroberts I've also been wondering... is there a reason |
@ladar Only because support was introduced as a plugin. I've been noticing an uptick in usage as well and will likely inquire with the author soon about the possibility of migrating it into vagrant proper. |
EDIT: Sorry for the rant, that wasn't appropriate. I'll rephrase my question to be a bit nicer (although it should probably go into a robox-specific issue anyways). @ladar Would it be possible to include a warning for the cases where the OS type is overwritten with |
@pzlds because at some point not setting it to Setting the type as A new type might work, but because I'm travelling, I can't easily build all 6 Alpine variants, for all 5 providers, and then subsequently test all 30 images, to ensure the bug is resolve, so I've left the existing config as-is for the time being. Perhaps adding box specific notes to the robox repo wiki section on this issue, and the workarounds could suffice for now. |
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. |
Vagrant version
2.2.3
Host operating system
Linux (openSUSE Tumbleweed)
Guest operating system
Alpine Linux 3.8
Vagrantfile
Debug output
https://gist.github.com/maxbrunet/7872a0c2f7ad87ce2a08b7e0438f83a0
Expected behavior
Alpine VM is up and requested hostname is set.
Actual behavior
vagrant up
fails onSetting hostname...
.Steps to reproduce
vagrant up
with the providedVagrantfile
References
There's this comment mentioning a similar error: #2745 (comment)
But there's other issues, it seems that changing the hostname is generally problematic.
The network service is called
networking
in Alpine and it looks like it uses theChangeHostName
class ofGuestALT
, is it the right guest class?Maybe it should use
GuestLinux
which doesn't support it, and skip the task or error as not supported.vagrant/plugins/guests/alt/cap/change_host_name.rb
Line 39 in 37dc3dc
Also the script doesn't seem to fail on the first error (
sed
on/etc/sysconfig/network
), maybe it should test if the file exists first and/or use something likeset -e
to be able to fail in middle.The text was updated successfully, but these errors were encountered: