Commit graph

189 commits

Author SHA1 Message Date
oss-core-libraries-dashboard[bot]
206f8102c9
[COMPLIANCE] Update Copyright and License Headers (Batch 2 of 7) (#13761)
Co-authored-by: hashicorp-copywrite[bot] <110428419+hashicorp-copywrite[bot]@users.noreply.github.com>
2025-12-22 16:46:17 +05:30
Emanuel Steen
abe87b2fdc Only clean up /etc/fstab if it really contains Vagrant data
This change, together with `allow_fstab_modification = false`, allows to run
a guest without root/sudo privileges which been broken since Vagrant 2.2.10.
2025-06-06 01:39:34 +05:30
Chris Roberts
ea25996b21
Update Vagrant behavior outside of installers
Remove customized require behaviors and modify the bin executable
to check for missing tools that Vagrant expects to exist when
running outside of an installer.
2025-04-02 11:40:17 -07:00
Chris Roberts
8b06640fcf
Use helper for require calls 2024-11-06 17:33:00 -08:00
hashicorp-copywrite[bot]
36a312ee26
add missing license headers and update copyright file headers to BUS-1.1 2023-08-10 21:53:25 +01:00
Chris Roberts
a088fbba39 Properly wait for reboot process to start
This adds a check to the `#wait_for_reboot` method on the linux
    guest reboot capability to determine if the a reboot is still
    in process. This prevents the reboot process from being initiated
    and the `#ready?` check on the guest being called before the
    system shutdown process has shutdown the communicator process.
2021-04-13 16:42:31 -07:00
sophia
82dde55e64 Get folder mount name 2021-04-06 16:25:08 -05:00
sophia
b30a87ce6c Extract os friendly mount name for vbox shared folders 2021-02-10 15:25:56 -06:00
Chris Roberts
4751353a5f Fetch reboot env var at run time and keep constant values constant
Keep the default duration as a constant and fetch the custom environment
variable at run time with a fallback to the default. Set the sleep duration
into a constant and add tests covering the expected behaviors when the
default duration is in use as well as the override value. Also match the
environment variable up with the constant just for consistency.
2020-11-03 15:11:10 -08:00
Arthur Maltson
a2f5d615a0 Make max reboot retry duration configurable
Previously the maximum amount of time Vagrant would poll for whether a
machine has successfully reboot was hard coded to 120 seconds. This
change introduces the VAGRANT_MAX_REBOOT_RETRY_TIMEOUT environment
variable to allow this attribute to be configurable.

Add RSpec tests of the maximum retry logic. Since the maximum retries
are configured as a constant, we'd need to reload the class and that's
fairly ugly to do in RSpec.

Fixes #11695
2020-10-31 18:00:01 -04:00
sophia
00e4810197 Add mount_name synced folder capability to get name of mount 2020-09-22 16:57:43 -05:00
sophia
11aeafea5c Add tests for smb mount options driven through synced folder capabilities 2020-09-22 16:56:11 -05:00
sophia
583b3f5332 Persist smb mounts 2020-09-22 16:53:10 -05:00
sophia
7e698b757d Mount smb folders using mount options from cap 2020-09-22 16:53:10 -05:00
sophia
0831df2e7f Create fstab if does not exist 2020-09-15 15:38:32 -05:00
sophia
41fa71081f Add check for /etc/fstab 2020-09-14 09:43:07 -05:00
sophia
56fa014af8 Don't persist shared folders if mount options capability not provided 2020-08-19 15:47:21 -05:00
Chris Roberts
cd2d84fda7 Adjust synced folder collection class 2020-08-19 15:00:40 -05:00
sophia
2a8372a272 Add mount type cap 2020-08-19 15:00:40 -05:00
sophia
7577c11eb6 Persist synced folders in action 2020-08-19 15:00:40 -05:00
sophia
2239ee8582 Create Hash with type attribute 2020-08-19 15:00:40 -05:00
sophia
cde39e26ba Make mount options a synced_folder capability 2020-08-19 15:00:40 -05:00
sophia
e4367d1539 Refactor linux change host cap 2020-08-05 15:12:45 -05:00
sophia
9eb431b1bf Clean up tests 2020-07-20 15:46:15 -05:00
sophia
5afd7fdd73 Extract change hostnamet base class 2020-07-20 15:19:50 -05:00
sophia
fe7968315b Add option to allow/disable fstab modification
Defaults to allow modification of fstab
2020-05-29 15:29:21 -04:00
sophia
1dc761a6c4 Refactor out persisting a mount to it's own guest cap 2020-05-29 15:26:48 -04:00
sophia
d7bd29384e Remove fstab if it is unable to successfully mount 2020-05-29 15:26:48 -04:00
sophia
b511d23ae1 Refresh fstab when folders synced 2020-05-29 15:26:48 -04:00
sophia
298027b70e Automatically mount virtual box shared folder when machine reboots
This is done by adding the mount to fstab
ref: https://askubuntu.com/questions/252853/how-to-mount-a-virtualbox-shared-folder-at-startup

Note, add `nofail` to mount options so as to not stop machine from booting if device disappears
2020-05-29 15:26:48 -04:00
sophia
30ade2991b Emit warning message if using mfsymlink 2020-04-17 09:56:52 -04:00
sophia
307291b7f8 Add mfsymlinks as a default option for mounting smb folders 2020-04-08 14:52:37 -04:00
Sophia Castellarin
cf9a690bc9
Merge pull request #11482 from soapy1/systemd-cap-halt
Use systemd to halt system if available
2020-04-06 10:18:53 -04:00
sophia
338f13a2ae Use systemd to halt system if available 2020-04-01 15:43:10 -04:00
sophia
777f680837 Use systemd to rebot system if available 2020-04-01 13:57:07 -04:00
Jeff Bonhag
307123c1f2
Fixes #10753: Add reboot support for Linux guests (#11194)
This commit adds support for setting `reboot: true` while using the
shell provisioner with Linux guests.
2019-11-15 14:46:36 -05:00
Chris Roberts
48d358adcb Add winrm and upload commands 2018-10-04 13:26:41 -07:00
Jeremy Maness
a73fb9c139 - Filter out empty strings when constructing the list of network interfaces
- Sort interfaces properly whose name does not contain a numeric suffix (e.g. lo)
- Filter out loopback interfaces
2018-08-04 21:16:51 -04:00
Chris Roberts
c571249000 Support VirtualBox shared folders using builtin kernel module
Check error output if initial mount command fails to determine if
the builtin module should be used for mounting instead.
2018-05-07 13:02:19 -07:00
Chris Roberts
55460379f1
Merge pull request #9315 from basvandervlies/ifconfig_obsolete
ifconfig is replaced by ip command suite. So use "ip addr" and failback
2018-01-16 20:12:18 -08:00
Chris Roberts
b1c38c282e Support SMB mount option overrides 2018-01-12 17:23:00 -08:00
Bas van der Vlies
de62baed6b as requested change to test to command:which 2018-01-08 08:53:33 +01:00
Bas van der Vlies
a5deb20dcb ifconfig is replaced by ip command suite. So use "ip addr" and failback
to ifconfig
2017-12-28 20:31:04 +01:00
Chris Roberts
2caf109a03 Mark passwords as sensitive within guest capabilities 2017-12-21 12:49:34 -08:00
Chris Roberts
00fa50c296 SMB enhancements 2017-12-21 09:55:19 -08:00
Chris Roberts
e85ef1655b Always remove credentials file after mount attempts 2017-12-21 09:55:19 -08:00
Brian Cain
0ac26be4ef (#8917) Fix shell_expand_guest_path capability
Prior to this commit, when the guest capability attempted to expand a
path with spaces it would quote the path passed in. However if the path
also had a relative path those quotes would end up making `printf`
ignore it and not properly expand the path fully. This commit updates
that to first escape the quotes of a path and then pass in the new path
to be expanded.
2017-08-25 10:02:36 -07:00
Brian Cain
2b8f7f67ea Add unit tests for shell_expand_guest_path function 2017-08-15 09:33:29 -07:00
Brian Cain
61c501cc65 Ensure paths with spaces are preserved
Prior to this commit, if a user set the `destination` path to include a
space, the `shell_expand_guest_path` function would remove that space
and return a partial path. This commit updates that to quote the path to
be expanded to preserve the entire path.
2017-08-14 15:34:10 -07:00
Chris Roberts
414184b76b guests/rhel: Update network configuration
Properly detects NetworkManager on guest as well as devices controlled
by NetworkManager. Provides configuration option to enable/disbale
NetworkManager control on devices.
2017-04-26 13:15:33 -07:00