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

[BENTO-111] Added a .gitattributes and a note for Windows hosts #157

Merged
merged 1 commit into from
Jan 17, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Detect text files automatically
* text=auto

# Force LF line ending on these files
*.sh eol=lf

ks.cfg eol=lf
preseed.cfg eol=lf

# Force CRLF line ending on these files
*.bat eol=crlf

# Force binary on these files
*.cer binary
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,28 @@ boxes yourself due to licensing constraints. You can build these as follows:
$ bundle install
$ bundle exec veewee vbox build [definition-name]

### Windows Hosts

When building boxes from a Windows host system, you must ensure that kickstart configuration files (`ks.cfg` for RHEL
based systems) and preseed files (`preseed.cfg` for Debian based systems) have Unix line endings (i.e. lines end with
LF character only). Moreover, it's also a good idea to have `*.sh` scripts with Unix line endings too.

When these files have Windows line endings, the group creation can fail in the pre-seed phase and in turn, prevents the
user `vagrant` to be created correctly. This ultimately results in Packer not being able to connect to the newly booted
up machine with an error message that looks like this:

```
==> virtualbox-iso: Waiting for SSH to become available...
==> virtualbox-iso: Error waiting for SSH: handshake failed: ssh: unable to authenticate, attempted methods [none password], no support
```

Since Packer tries to log in with user `vagrant` but it was not created successfully in the pre-seed phase, it is unable
to connect to the machine and the packaging process stops.

By default, when cloning this repository, git should normalized `ks.cfg`, `preseed.cfg` and `*.sh` to Unix line endings
and `*.bat` to Windows line endings, thanks to the [.gitattributes](.gitattributes) file in the repository. However, if
it's not the case, convert the offending files so they have the correct line endings.

## Bugs and Issues

Use the [issue tracker](http://tickets.opscode.com/browse/BENTO) to report
Expand Down