Make it work on Windows #6

Closed
jedi4ever opened this Issue Feb 10, 2011 · 56 comments

Comments

Projects
None yet
@jedi4ever
Owner

jedi4ever commented Feb 10, 2011

Not tested yet, but need to have access to a windows box for doing that

@adurity

This comment has been minimized.

Show comment
Hide comment
@adurity

adurity May 12, 2011

First breaking point appears to be when building the basebox, specifically when trying to create the VM using command line calls to VirtualBox as opposed to ruby-virtualbox. Error dump:

FFI::NotFoundError: Function 'forkpty' not found in [msvcrt.dll]
  attach_function at C:/jruby-1.6.1/lib/ruby/site_ruby/shared/ffi/library.rb:100
             each at org/jruby/RubyArray.java:1602
  attach_function at C:/jruby-1.6.1/lib/ruby/site_ruby/shared/ffi/library.rb:96
          LibUtil at C:/jruby-1.6.1/lib/ruby/site_ruby/shared/pty.rb:12
              PTY at C:/jruby-1.6.1/lib/ruby/site_ruby/shared/pty.rb:5
           (root) at C:/jruby-1.6.1/lib/ruby/site_ruby/shared/pty.rb:3
          require at org/jruby/RubyKernel.java:1038
          require at C:/jruby-1.6.1/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:29
          execute at C:/jruby-1.6.1/lib/ruby/site_ruby/shared/pty.rb:14
        create_vm at C:/jruby-1.6.1/lib/ruby/gems/1.8/gems/veewee-0.1.22/lib/veewee/session.rb:508
            build at C:/jruby-1.6.1/lib/ruby/gems/1.8/gems/veewee-0.1.22/lib/veewee/session.rb:270
      transaction at C:/jruby-1.6.1/lib/ruby/gems/1.8/gems/veewee-0.1.22/lib/veewee/session.rb:841
            build at C:/jruby-1.6.1/lib/ruby/gems/1.8/gems/veewee-0.1.22/lib/veewee/session.rb:267
            build at C:/jruby-1.6.1/lib/ruby/gems/1.8/gems/veewee-0.1.22/lib/veewee/command.rb:46
             send at org/jruby/RubyKernel.java:2056
              run at C:/jruby-1.6.1/lib/ruby/gems/1.8/gems/thor-0.14.6/lib/thor/task.rb:21
      invoke_task at C:/jruby-1.6.1/lib/ruby/gems/1.8/gems/thor-0.14.6/lib/thor/invocation.rb:118
         dispatch at C:/jruby-1.6.1/lib/ruby/gems/1.8/gems/thor-0.14.6/lib/thor.rb:263
             send at org/jruby/RubyKernel.java:2064
           invoke at C:/jruby-1.6.1/lib/ruby/gems/1.8/gems/thor-0.14.6/lib/thor/invocation.rb:109
          basebox at C:/jruby-1.6.1/lib/ruby/gems/1.8/gems/thor-0.14.6/lib/thor.rb:205
             call at org/jruby/RubyProc.java:268
             send at org/jruby/RubyKernel.java:2060
              run at C:/jruby-1.6.1/lib/ruby/gems/1.8/gems/thor-0.14.6/lib/thor/task.rb:21
      invoke_task at C:/jruby-1.6.1/lib/ruby/gems/1.8/gems/thor-0.14.6/lib/thor/invocation.rb:118
         dispatch at C:/jruby-1.6.1/lib/ruby/gems/1.8/gems/thor-0.14.6/lib/thor.rb:263
            start at C:/jruby-1.6.1/lib/ruby/gems/1.8/gems/thor-0.14.6/lib/thor/base.rb:389
           (root) at C:/jruby-1.6.1/lib/ruby/gems/1.8/gems/vagrant-0.7.4/bin/vagrant:15
             load at org/jruby/RubyKernel.java:1063
           (root) at C:/jruby-1.6.1/bin/vagrant:19

What's required in the virtualbox gem to make this work without calls through a pty?

adurity commented May 12, 2011

First breaking point appears to be when building the basebox, specifically when trying to create the VM using command line calls to VirtualBox as opposed to ruby-virtualbox. Error dump:

FFI::NotFoundError: Function 'forkpty' not found in [msvcrt.dll]
  attach_function at C:/jruby-1.6.1/lib/ruby/site_ruby/shared/ffi/library.rb:100
             each at org/jruby/RubyArray.java:1602
  attach_function at C:/jruby-1.6.1/lib/ruby/site_ruby/shared/ffi/library.rb:96
          LibUtil at C:/jruby-1.6.1/lib/ruby/site_ruby/shared/pty.rb:12
              PTY at C:/jruby-1.6.1/lib/ruby/site_ruby/shared/pty.rb:5
           (root) at C:/jruby-1.6.1/lib/ruby/site_ruby/shared/pty.rb:3
          require at org/jruby/RubyKernel.java:1038
          require at C:/jruby-1.6.1/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:29
          execute at C:/jruby-1.6.1/lib/ruby/site_ruby/shared/pty.rb:14
        create_vm at C:/jruby-1.6.1/lib/ruby/gems/1.8/gems/veewee-0.1.22/lib/veewee/session.rb:508
            build at C:/jruby-1.6.1/lib/ruby/gems/1.8/gems/veewee-0.1.22/lib/veewee/session.rb:270
      transaction at C:/jruby-1.6.1/lib/ruby/gems/1.8/gems/veewee-0.1.22/lib/veewee/session.rb:841
            build at C:/jruby-1.6.1/lib/ruby/gems/1.8/gems/veewee-0.1.22/lib/veewee/session.rb:267
            build at C:/jruby-1.6.1/lib/ruby/gems/1.8/gems/veewee-0.1.22/lib/veewee/command.rb:46
             send at org/jruby/RubyKernel.java:2056
              run at C:/jruby-1.6.1/lib/ruby/gems/1.8/gems/thor-0.14.6/lib/thor/task.rb:21
      invoke_task at C:/jruby-1.6.1/lib/ruby/gems/1.8/gems/thor-0.14.6/lib/thor/invocation.rb:118
         dispatch at C:/jruby-1.6.1/lib/ruby/gems/1.8/gems/thor-0.14.6/lib/thor.rb:263
             send at org/jruby/RubyKernel.java:2064
           invoke at C:/jruby-1.6.1/lib/ruby/gems/1.8/gems/thor-0.14.6/lib/thor/invocation.rb:109
          basebox at C:/jruby-1.6.1/lib/ruby/gems/1.8/gems/thor-0.14.6/lib/thor.rb:205
             call at org/jruby/RubyProc.java:268
             send at org/jruby/RubyKernel.java:2060
              run at C:/jruby-1.6.1/lib/ruby/gems/1.8/gems/thor-0.14.6/lib/thor/task.rb:21
      invoke_task at C:/jruby-1.6.1/lib/ruby/gems/1.8/gems/thor-0.14.6/lib/thor/invocation.rb:118
         dispatch at C:/jruby-1.6.1/lib/ruby/gems/1.8/gems/thor-0.14.6/lib/thor.rb:263
            start at C:/jruby-1.6.1/lib/ruby/gems/1.8/gems/thor-0.14.6/lib/thor/base.rb:389
           (root) at C:/jruby-1.6.1/lib/ruby/gems/1.8/gems/vagrant-0.7.4/bin/vagrant:15
             load at org/jruby/RubyKernel.java:1063
           (root) at C:/jruby-1.6.1/bin/vagrant:19

What's required in the virtualbox gem to make this work without calls through a pty?

@jedi4ever

This comment has been minimized.

Show comment
Hide comment
@jedi4ever

jedi4ever May 13, 2011

Owner

Ah, yes the pty command does not work on windows...Popen should

Could you activate swap self.execute2 with self.excute ?

https://github.com/jedi4ever/veewee/blob/master/lib/veewee/shell.rb

Owner

jedi4ever commented May 13, 2011

Ah, yes the pty command does not work on windows...Popen should

Could you activate swap self.execute2 with self.excute ?

https://github.com/jedi4ever/veewee/blob/master/lib/veewee/shell.rb

@jedi4ever

This comment has been minimized.

Show comment
Hide comment
@jedi4ever

jedi4ever May 24, 2011

Owner

@adurity any update on this? Would be interested in hearing your experiences

Owner

jedi4ever commented May 24, 2011

@adurity any update on this? Would be interested in hearing your experiences

@adurity

This comment has been minimized.

Show comment
Hide comment
@adurity

adurity Jun 2, 2011

Haven't yet had a chance to revisit this issue. I should be able to investigate in the next few days.

adurity commented Jun 2, 2011

Haven't yet had a chance to revisit this issue. I should be able to investigate in the next few days.

@ilkka

This comment has been minimized.

Show comment
Hide comment
@ilkka

ilkka Jul 4, 2011

I did the suggested change (altered the body of execute to just call execute2) but then it fails when it doesn't find VBoxManage in the PATH. I guess having it in PATH is a hard requirement then?

Oh, and I'm using jRuby 1.6.2 on W7.

ilkka commented Jul 4, 2011

I did the suggested change (altered the body of execute to just call execute2) but then it fails when it doesn't find VBoxManage in the PATH. I guess having it in PATH is a hard requirement then?

Oh, and I'm using jRuby 1.6.2 on W7.

@ilkka

This comment has been minimized.

Show comment
Hide comment
@ilkka

ilkka Jul 4, 2011

Sadly even with VBox in PATH (and after giving JRuby enough heap) it doesn't work:

C:\Users\ilau\Documents\veewee>vagrant basebox build natty
PROGID: VirtualBox.VirtualBox
PROGID: VirtualBox.Session
PROGID: VirtualBox.VirtualBox
PROGID: VirtualBox.Session
PROGID: VirtualBox.VirtualBox
PROGID: VirtualBox.Session

We did not find an isofile in <currentdir>/iso.

The definition provided the following download information:
- Download url: http://releases.ubuntu.com/11.04/ubuntu-11.04-server-amd64.iso
- Md5 Checksum: ce1cee108de737d7492e37069eed538e


Download? (Yes/No)  |No|
yes
Creating an iso directory
#<IO:0x2044dd6>#<IO:0x28491a8a>#<IO:0x15740c66>we tried to create a box or a box was here before
but now it's gone

It's not totally clear from the output but the download does finish before that error message.

ilkka commented Jul 4, 2011

Sadly even with VBox in PATH (and after giving JRuby enough heap) it doesn't work:

C:\Users\ilau\Documents\veewee>vagrant basebox build natty
PROGID: VirtualBox.VirtualBox
PROGID: VirtualBox.Session
PROGID: VirtualBox.VirtualBox
PROGID: VirtualBox.Session
PROGID: VirtualBox.VirtualBox
PROGID: VirtualBox.Session

We did not find an isofile in <currentdir>/iso.

The definition provided the following download information:
- Download url: http://releases.ubuntu.com/11.04/ubuntu-11.04-server-amd64.iso
- Md5 Checksum: ce1cee108de737d7492e37069eed538e


Download? (Yes/No)  |No|
yes
Creating an iso directory
#<IO:0x2044dd6>#<IO:0x28491a8a>#<IO:0x15740c66>we tried to create a box or a box was here before
but now it's gone

It's not totally clear from the output but the download does finish before that error message.

@ilkka

This comment has been minimized.

Show comment
Hide comment
@ilkka

ilkka Jul 4, 2011

I figured out the problem above, that was due to the block passed to IO.popen in Veewee::Shell.execute2 just printing its end of the pipe. I changed execute2 to do

print IO.popen(command).readlines

instead, and got a bit further. The next problem is that Session.create_disk expects to be able to run grep, cut and sed.

ilkka commented Jul 4, 2011

I figured out the problem above, that was due to the block passed to IO.popen in Veewee::Shell.execute2 just printing its end of the pipe. I changed execute2 to do

print IO.popen(command).readlines

instead, and got a bit further. The next problem is that Session.create_disk expects to be able to run grep, cut and sed.

@ilkka

This comment has been minimized.

Show comment
Hide comment
@ilkka

ilkka Jul 4, 2011

I can't quite figure out what execute() is supposed to return? Transaction.list_snapshots wants to call "stdout" on the result?

ilkka commented Jul 4, 2011

I can't quite figure out what execute() is supposed to return? Transaction.list_snapshots wants to call "stdout" on the result?

@jedi4ever

This comment has been minimized.

Show comment
Hide comment
@jedi4ever

jedi4ever Jul 12, 2011

Owner

The result of the exec is an object that contains the stderr and stdout of the command just executed. List Snapshots use it as this is the only way to find the snapshots through the VBoxManage command. I agree that the grep and piping could be done in ruby instead of using the shell commands. That will probably make it work on windows too.

Owner

jedi4ever commented Jul 12, 2011

The result of the exec is an object that contains the stderr and stdout of the command just executed. List Snapshots use it as this is the only way to find the snapshots through the VBoxManage command. I agree that the grep and piping could be done in ruby instead of using the shell commands. That will probably make it work on windows too.

@pshields

This comment has been minimized.

Show comment
Hide comment
@pshields

pshields Oct 13, 2011

I made some small modifications on my fork at https://github.com/pshields/veewee so I could build a VM on Windows. Mainly I removed things that got in the way. I have Cygwin installed, so there might be more steps to be taken if you don't.

Summary of changes:

  • Rename Veewee::Shell.execute2 to Veewee::Shell.execute to use as default (the other execute definition wouldn't work for me due to a 'forkpty' not found error)
  • Remove webrick logger from Veewee::Web.wait_for_response (it references /dev/null, which isn't Windows-compatible)
  • Remove absolute paths from Veeweee::Session.create_disk, Veewee::Session.attach_disk (they assume unix-style filepaths)
    • A side effect of this is that created hard drive files reside in the current directory
  • Use Veewee::Shell.execute instead of IO.popen in Veewee::Scancode.send_sequence (scancodes didn't seem to be getting received by the VM until I did this. I'm not sure why.)

That was basically it in order to build the VM. I'm still working on some things, so check my repo for specific changes.

Incidentally, I'm not even using Vagrant at the moment (except as a Veewee dependency.) I just want a nice way to turn a standard Ubuntu .iso, a preseed.cfg and a postinstall.sh script into a custom VirtualBox VM. If anyone has any better ideas, please let me know.

I made some small modifications on my fork at https://github.com/pshields/veewee so I could build a VM on Windows. Mainly I removed things that got in the way. I have Cygwin installed, so there might be more steps to be taken if you don't.

Summary of changes:

  • Rename Veewee::Shell.execute2 to Veewee::Shell.execute to use as default (the other execute definition wouldn't work for me due to a 'forkpty' not found error)
  • Remove webrick logger from Veewee::Web.wait_for_response (it references /dev/null, which isn't Windows-compatible)
  • Remove absolute paths from Veeweee::Session.create_disk, Veewee::Session.attach_disk (they assume unix-style filepaths)
    • A side effect of this is that created hard drive files reside in the current directory
  • Use Veewee::Shell.execute instead of IO.popen in Veewee::Scancode.send_sequence (scancodes didn't seem to be getting received by the VM until I did this. I'm not sure why.)

That was basically it in order to build the VM. I'm still working on some things, so check my repo for specific changes.

Incidentally, I'm not even using Vagrant at the moment (except as a Veewee dependency.) I just want a nice way to turn a standard Ubuntu .iso, a preseed.cfg and a postinstall.sh script into a custom VirtualBox VM. If anyone has any better ideas, please let me know.

@pshields

This comment has been minimized.

Show comment
Hide comment
@pshields

pshields Oct 15, 2011

A few more notes on what I did to get Veewee 0.2.0 basebox building working in Windows with JRuby 1.6.4:

  1. Install VirtualBox and add the installation directory (e.g. C:\Program Files\Oracle\VirtualBox) to the PATH.
  2. Install JRuby (64-bit, with JRE)
  3. Install msysgit (select "Run Git from the Windows Command Prompt" and "Check out as-is, commit Unix-style line endings" during the installation.)
  4. Save the .iso you want to use into the iso\ folder (I encountered errors when veewee tried to do it.)
  5. Run in a command prompt:
jgem install rubygems-update
jgem update --system
jgem install vagrant jruby-openssl bundler
git clone https://github.com/pshields/veewee.git veewee\
cd veewee\
bundle install
rake install

After that, vagrant basebox build vm-name should work (with the caveat that virtual hard disks will be created / looked for in the current directory.)

A few more notes on what I did to get Veewee 0.2.0 basebox building working in Windows with JRuby 1.6.4:

  1. Install VirtualBox and add the installation directory (e.g. C:\Program Files\Oracle\VirtualBox) to the PATH.
  2. Install JRuby (64-bit, with JRE)
  3. Install msysgit (select "Run Git from the Windows Command Prompt" and "Check out as-is, commit Unix-style line endings" during the installation.)
  4. Save the .iso you want to use into the iso\ folder (I encountered errors when veewee tried to do it.)
  5. Run in a command prompt:
jgem install rubygems-update
jgem update --system
jgem install vagrant jruby-openssl bundler
git clone https://github.com/pshields/veewee.git veewee\
cd veewee\
bundle install
rake install

After that, vagrant basebox build vm-name should work (with the caveat that virtual hard disks will be created / looked for in the current directory.)

@brugidou

This comment has been minimized.

Show comment
Hide comment
@brugidou

brugidou Oct 24, 2011

I successfully built a box from windows today by patching using commits in https://github.com/pshields/veewee
Are you guys planning on doing a pull request? this would be a great addition to make veewee compatible with windows hosts.

I successfully built a box from windows today by patching using commits in https://github.com/pshields/veewee
Are you guys planning on doing a pull request? this would be a great addition to make veewee compatible with windows hosts.

@pshields

This comment has been minimized.

Show comment
Hide comment
@pshields

pshields Oct 25, 2011

I'm glad it worked for you! I'll try to create a more complete, functionality-preserving Windows compatibility patch in the next few days if @jedi4ever is interested.

I'm glad it worked for you! I'll try to create a more complete, functionality-preserving Windows compatibility patch in the next few days if @jedi4ever is interested.

@jedi4ever

This comment has been minimized.

Show comment
Hide comment
@jedi4ever

jedi4ever Oct 26, 2011

Owner

I'm definitely interested, but there is a complete rewrite in the making, need to check if this will work on windows as well.

Owner

jedi4ever commented Oct 26, 2011

I'm definitely interested, but there is a complete rewrite in the making, need to check if this will work on windows as well.

@adrianmak

This comment has been minimized.

Show comment
Hide comment
@adrianmak

adrianmak Nov 3, 2011

@pshields,

Where did you place the veewee folder ?

@pshields,

Where did you place the veewee folder ?

@pshields

This comment has been minimized.

Show comment
Hide comment
@pshields

pshields Nov 3, 2011

In a tmp folder in the folder I am building the VM in. After you run rake install I think the veewee commands should be available anywhere though. The created virtual hard drive should be created in whatever folder you run the script in.

pshields commented Nov 3, 2011

In a tmp folder in the folder I am building the VM in. After you run rake install I think the veewee commands should be available anywhere though. The created virtual hard drive should be created in whatever folder you run the script in.

@jedi4ever

This comment has been minimized.

Show comment
Hide comment
@jedi4ever

jedi4ever Nov 26, 2011

Owner

Veewee v0.3 will be completely different, I solved :

  • the grep/sed problem
  • the popen vs. pty
  • webrick /dev/null
  • disk paths use File.join instead of '/'

It will be interesting if you guys try to do the same work for the new version (0.3 branch) and try it out

Owner

jedi4ever commented Nov 26, 2011

Veewee v0.3 will be completely different, I solved :

  • the grep/sed problem
  • the popen vs. pty
  • webrick /dev/null
  • disk paths use File.join instead of '/'

It will be interesting if you guys try to do the same work for the new version (0.3 branch) and try it out

@pshields

This comment has been minimized.

Show comment
Hide comment
@pshields

pshields Nov 29, 2011

Installing the libxml-ruby gem dependency fails when I try to install veewee 0.3.0-alpha4. libxml-ruby doesn't seem compatible with Windows. I haven't found any easy workarounds yet.

Installing the libxml-ruby gem dependency fails when I try to install veewee 0.3.0-alpha4. libxml-ruby doesn't seem compatible with Windows. I haven't found any easy workarounds yet.

@jedi4ever

This comment has been minimized.

Show comment
Hide comment
@jedi4ever

jedi4ever Nov 29, 2011

Owner

@pshields thanks for trying! Could you give me any output you get while installing?

There seem to be several docs on installing it, but without the actual error it's hard to help.
http://vairoj.com/2010/06/installing-libxml-ruby-on-windows-the-painless-way.html

Owner

jedi4ever commented Nov 29, 2011

@pshields thanks for trying! Could you give me any output you get while installing?

There seem to be several docs on installing it, but without the actual error it's hard to help.
http://vairoj.com/2010/06/installing-libxml-ruby-on-windows-the-painless-way.html

@jedi4ever

This comment has been minimized.

Show comment
Hide comment
@jedi4ever

jedi4ever Nov 29, 2011

Owner

Ha I see now, the libxml-ruby gem is only needed for reading the property files for the vmfusion part.
Let me see if I can relax that constraint.

Owner

jedi4ever commented Nov 29, 2011

Ha I see now, the libxml-ruby gem is only needed for reading the property files for the vmfusion part.
Let me see if I can relax that constraint.

@pshields

This comment has been minimized.

Show comment
Hide comment
@pshields

pshields Nov 29, 2011

Here's my output. The first time it ran it also showed the gems it was retrieving.

C:\Users\Patrick>gem install veewee -v 0.3.0alpha4
Building native extensions.  This could take a while...
ERROR:  Error installing veewee:
        ERROR: Failed to build gem native extension.

        c:/jruby-1.6.5/bin/jruby.exe extconf.rb
WARNING: JRuby does not support native extensions or the `mkmf' library very wel
l.
Check http://kenai.com/projects/jruby/pages/Home for alternatives.
checking for socket() in -lsocket... no
checking for gethostbyname() in -lnsl... no
checking for atan() in -lm... no
checking for atan() in -lm... no
 extconf failure: need libm
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers.  Check the mkmf.log file for more
details.  You may need configuration options.

Provided configuration options:
        --with-opt-dir
        --without-opt-dir
        --with-opt-include
        --without-opt-include=${opt-dir}/include
        --with-opt-lib
        --without-opt-lib=${opt-dir}/lib
        --with-make-prog
        --without-make-prog
        --srcdir=.
        --curdir
        --ruby=c:/jruby-1.6.5/bin/jruby
        --with-iconv-dir
        --without-iconv-dir
        --with-iconv-include
        --without-iconv-include=${iconv-dir}/include
        --with-iconv-lib
        --without-iconv-lib=${iconv-dir}/lib
        --with-zlib-dir
        --without-zlib-dir
        --with-zlib-include
        --without-zlib-include=${zlib-dir}/include
        --with-zlib-lib
        --without-zlib-lib=${zlib-dir}/lib
        --with-socketlib
        --without-socketlib
        --with-nsllib
        --without-nsllib
        --with-mlib
        --without-mlib
        --with-mlib
        --without-mlib


Gem files will remain installed in c:/jruby-1.6.5/lib/ruby/gems/1.8/gems/libxml-
ruby-2.2.2 for inspection.
Results logged to c:/jruby-1.6.5/lib/ruby/gems/1.8/gems/libxml-ruby-2.2.2/ext/li
bxml/gem_make.out

Here's my output. The first time it ran it also showed the gems it was retrieving.

C:\Users\Patrick>gem install veewee -v 0.3.0alpha4
Building native extensions.  This could take a while...
ERROR:  Error installing veewee:
        ERROR: Failed to build gem native extension.

        c:/jruby-1.6.5/bin/jruby.exe extconf.rb
WARNING: JRuby does not support native extensions or the `mkmf' library very wel
l.
Check http://kenai.com/projects/jruby/pages/Home for alternatives.
checking for socket() in -lsocket... no
checking for gethostbyname() in -lnsl... no
checking for atan() in -lm... no
checking for atan() in -lm... no
 extconf failure: need libm
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers.  Check the mkmf.log file for more
details.  You may need configuration options.

Provided configuration options:
        --with-opt-dir
        --without-opt-dir
        --with-opt-include
        --without-opt-include=${opt-dir}/include
        --with-opt-lib
        --without-opt-lib=${opt-dir}/lib
        --with-make-prog
        --without-make-prog
        --srcdir=.
        --curdir
        --ruby=c:/jruby-1.6.5/bin/jruby
        --with-iconv-dir
        --without-iconv-dir
        --with-iconv-include
        --without-iconv-include=${iconv-dir}/include
        --with-iconv-lib
        --without-iconv-lib=${iconv-dir}/lib
        --with-zlib-dir
        --without-zlib-dir
        --with-zlib-include
        --without-zlib-include=${zlib-dir}/include
        --with-zlib-lib
        --without-zlib-lib=${zlib-dir}/lib
        --with-socketlib
        --without-socketlib
        --with-nsllib
        --without-nsllib
        --with-mlib
        --without-mlib
        --with-mlib
        --without-mlib


Gem files will remain installed in c:/jruby-1.6.5/lib/ruby/gems/1.8/gems/libxml-
ruby-2.2.2 for inspection.
Results logged to c:/jruby-1.6.5/lib/ruby/gems/1.8/gems/libxml-ruby-2.2.2/ext/li
bxml/gem_make.out
@ilkka

This comment has been minimized.

Show comment
Hide comment
@ilkka

ilkka Jan 16, 2012

libxml-ruby + jruby seems to be a common pain point. Could veewee use libxml-jruby instead, when on jruby?

...hurr durr, it's further down the dependency chain than that, nevermind.

It's actually CFPropertyList.

ilkka commented Jan 16, 2012

libxml-ruby + jruby seems to be a common pain point. Could veewee use libxml-jruby instead, when on jruby?

...hurr durr, it's further down the dependency chain than that, nevermind.

It's actually CFPropertyList.

@ilkka

This comment has been minimized.

Show comment
Hide comment
@ilkka

ilkka Jan 16, 2012

Actually, could the vmfusion provider be disabled for windows + jruby combos? Seems like it wouldn't even serve a purpose there, and that seems to be the only place where CFPropertyList is used.

ilkka commented Jan 16, 2012

Actually, could the vmfusion provider be disabled for windows + jruby combos? Seems like it wouldn't even serve a purpose there, and that seems to be the only place where CFPropertyList is used.

@ilkka

This comment has been minimized.

Show comment
Hide comment
@ilkka

ilkka Jan 16, 2012

I built and installed a version of CFPropertyList that depends on libxml-jruby instead (don't even know if it works but no matter) and added the VirtualBox directory to PATH, and after this box building fails on the "VBoxManage createvm" invocation. The reason is the single quotes around the --ostype value: they are not interpreted by the shell but are instead passed to the command, which barfs because it doesn't recognize the os type. Using double quotes would fix this I guess.

...I guess all the vbox commands would need to be changed to use double quotes.

ilkka commented Jan 16, 2012

I built and installed a version of CFPropertyList that depends on libxml-jruby instead (don't even know if it works but no matter) and added the VirtualBox directory to PATH, and after this box building fails on the "VBoxManage createvm" invocation. The reason is the single quotes around the --ostype value: they are not interpreted by the shell but are instead passed to the command, which barfs because it doesn't recognize the os type. Using double quotes would fix this I guess.

...I guess all the vbox commands would need to be changed to use double quotes.

@ilkka

This comment has been minimized.

Show comment
Hide comment
@ilkka

ilkka Jan 16, 2012

As I was hacking away on this (on the veewee03 branch) I noticed something odd: why, in create_disk() in lib/veewee/provider/virtualbox/box/create.rb, is there a File.new(place) in the arguments to File.join?

ilkka commented Jan 16, 2012

As I was hacking away on this (on the veewee03 branch) I noticed something odd: why, in create_disk() in lib/veewee/provider/virtualbox/box/create.rb, is there a File.new(place) in the arguments to File.join?

@ilkka

This comment has been minimized.

Show comment
Hide comment
@ilkka

ilkka Jan 16, 2012

Damn, got pretty far but then when veewee says that it's waiting 100 s for an SSH connection, I can't connect to the port it gives (although Windows' netstat shows it as listening).

ilkka commented Jan 16, 2012

Damn, got pretty far but then when veewee says that it's waiting 100 s for an SSH connection, I can't connect to the port it gives (although Windows' netstat shows it as listening).

@ilkka

This comment has been minimized.

Show comment
Hide comment
@ilkka

ilkka Jan 16, 2012

My ongoing effort is now here: https://github.com/ilkka/veewee/commits/veewee03

In addition to this I have installed a version of CFPropertyList that's changed to depend on libxml-jruby. Even with that installed however, you seem have to install veewee with --ignore-dependencies lest it try to build the unpatched one. With this setup "vbox build" gets as far as waiting for an SSH connection, but connections to the given port are immediately refused.

ilkka commented Jan 16, 2012

My ongoing effort is now here: https://github.com/ilkka/veewee/commits/veewee03

In addition to this I have installed a version of CFPropertyList that's changed to depend on libxml-jruby. Even with that installed however, you seem have to install veewee with --ignore-dependencies lest it try to build the unpatched one. With this setup "vbox build" gets as far as waiting for an SSH connection, but connections to the given port are immediately refused.

@whren

This comment has been minimized.

Show comment
Hide comment
@whren

whren Apr 11, 2012

Contributor

I have made a fork from the master and successfully define/build/export/add/init/up a box on windows 7 x64.
What I've done so far - https://github.com/whren/veewee.git :

  • Replacing simple quotes by double quotes as mentioned by ikka as VirtualBox does not support simple quote on windows
  • Fixed the get_vbox_home for windows as the 'Default machine path' from VBoxManage would include a drive letter, then a ':', so the split didn't correctly work in this case (ie "Default machine folder: C:\Users[myUserName]\VirtualBox VMs" was resolved to "C" instead of "C:\Users[myUserName]\VirtualBox VMs").
  • Forced opening of files for writing and Tempfile in binary mode to prevent windows CR+LF line end style (see http://www.ruby-forum.com/topic/60697#58748 and http://www.ruby-forum.com/topic/127453#568546)
  • Fixed a defect, not windows related, for the nogui option not working
  • Include equivalent of pull request 252 (ui confirm switch to success as confirm does not exists in vagrant ui) - see #252
  • Changed CRPropertyList dependency version as libxml-ruby dependency has been removed in version 2.1.1 allowing to build veewee on windows x64 - see ckruse/CFPropertyList#14
  • Added an optional pre_postinstall_file in definition, allowing a script to be executed before each postinstall script. The purpose is, for ie, to export proxy env (http_proxy, https_proxy) for working behing a proxy, but not to add such modifications in the future box (modifying /etc/profile for ie). Thanks to this I can build a box behind a proxy, and later, choose to wheter set a fixed proxy by provisioning in the vm.
Contributor

whren commented Apr 11, 2012

I have made a fork from the master and successfully define/build/export/add/init/up a box on windows 7 x64.
What I've done so far - https://github.com/whren/veewee.git :

  • Replacing simple quotes by double quotes as mentioned by ikka as VirtualBox does not support simple quote on windows
  • Fixed the get_vbox_home for windows as the 'Default machine path' from VBoxManage would include a drive letter, then a ':', so the split didn't correctly work in this case (ie "Default machine folder: C:\Users[myUserName]\VirtualBox VMs" was resolved to "C" instead of "C:\Users[myUserName]\VirtualBox VMs").
  • Forced opening of files for writing and Tempfile in binary mode to prevent windows CR+LF line end style (see http://www.ruby-forum.com/topic/60697#58748 and http://www.ruby-forum.com/topic/127453#568546)
  • Fixed a defect, not windows related, for the nogui option not working
  • Include equivalent of pull request 252 (ui confirm switch to success as confirm does not exists in vagrant ui) - see #252
  • Changed CRPropertyList dependency version as libxml-ruby dependency has been removed in version 2.1.1 allowing to build veewee on windows x64 - see ckruse/CFPropertyList#14
  • Added an optional pre_postinstall_file in definition, allowing a script to be executed before each postinstall script. The purpose is, for ie, to export proxy env (http_proxy, https_proxy) for working behing a proxy, but not to add such modifications in the future box (modifying /etc/profile for ie). Thanks to this I can build a box behind a proxy, and later, choose to wheter set a fixed proxy by provisioning in the vm.
@nigma

This comment has been minimized.

Show comment
Hide comment
@nigma

nigma Apr 13, 2012

Contributor

I'm not actually using Ruby and it took me several hours to figure out all this, but I can confirm that I was able to successfully run @whren's (thanks!) version of veewee on Ruby 1.9.3p125 with DevKit for building native extensions (both packages from the RubyInstaller project).

Some minor issues that I have encountered were:

  • Platform check in https://github.com/whren/veewee/blob/915f519682ecb32942bb72565891e08436ec2ff1/lib/veewee/provider/virtualbox/box/helper/create.rb#L43 raised an error

    C:/Ruby193/lib/ruby/gems/1.9.1/gems/veewee-0.3.0.alpha4/lib/veewee/provider/virtualbox/box/helper/create.rb:43:in
    'get_vbox_home': uninitialized constant Veewee::Provider::Virtualbox::BoxCommand::Vagrant (NameError)
    
  • I had to manually download iso image files and put them in the iso directory. Otherwise I got "permission denied" for fileutils's mv/rename in the download_iso function. I'm not sure what the cause might be.

  • After modifying and saving a postinstall.sh script I didn't notice it has CRLF line endings. sh doesn't like that and the script failed to run in the guest OS. I think this can be a common case so maybe some kind of warning or automatic conversion would be a good idea.

Apart from that and some beginner's issues with ruby and gems it went all smooth.

Contributor

nigma commented Apr 13, 2012

I'm not actually using Ruby and it took me several hours to figure out all this, but I can confirm that I was able to successfully run @whren's (thanks!) version of veewee on Ruby 1.9.3p125 with DevKit for building native extensions (both packages from the RubyInstaller project).

Some minor issues that I have encountered were:

  • Platform check in https://github.com/whren/veewee/blob/915f519682ecb32942bb72565891e08436ec2ff1/lib/veewee/provider/virtualbox/box/helper/create.rb#L43 raised an error

    C:/Ruby193/lib/ruby/gems/1.9.1/gems/veewee-0.3.0.alpha4/lib/veewee/provider/virtualbox/box/helper/create.rb:43:in
    'get_vbox_home': uninitialized constant Veewee::Provider::Virtualbox::BoxCommand::Vagrant (NameError)
    
  • I had to manually download iso image files and put them in the iso directory. Otherwise I got "permission denied" for fileutils's mv/rename in the download_iso function. I'm not sure what the cause might be.

  • After modifying and saving a postinstall.sh script I didn't notice it has CRLF line endings. sh doesn't like that and the script failed to run in the guest OS. I think this can be a common case so maybe some kind of warning or automatic conversion would be a good idea.

Apart from that and some beginner's issues with ruby and gems it went all smooth.

@whren

This comment has been minimized.

Show comment
Hide comment
@whren

whren Apr 13, 2012

Contributor

Glad to hear you have successfully build a box on windows !

  • I'll check about the platform check as i didn't face it.
  • I've planned to commit a fix for the mv on this week end (it is due to the source not closed, and windows keep an handle opened on the iso). I never faced this issue before because i was having locally downloaded isos.
  • The CRLF line endings needs to be addressed on you're GIT client side by issuing a "git autocrlf false" (or something like that), i can't do anything for that but you're right, the good thing to do on windows is to make sure to convert CRLF of postinstall sh files before building your box.
Contributor

whren commented Apr 13, 2012

Glad to hear you have successfully build a box on windows !

  • I'll check about the platform check as i didn't face it.
  • I've planned to commit a fix for the mv on this week end (it is due to the source not closed, and windows keep an handle opened on the iso). I never faced this issue before because i was having locally downloaded isos.
  • The CRLF line endings needs to be addressed on you're GIT client side by issuing a "git autocrlf false" (or something like that), i can't do anything for that but you're right, the good thing to do on windows is to make sure to convert CRLF of postinstall sh files before building your box.
@whren

This comment has been minimized.

Show comment
Hide comment
@whren

whren Apr 15, 2012

Contributor

Issues resolved, see :

Platform check error - whren#1
and
"Permissions denied" when downloading iso - whren#2

Let me know if this is ok

Contributor

whren commented Apr 15, 2012

Issues resolved, see :

Platform check error - whren#1
and
"Permissions denied" when downloading iso - whren#2

Let me know if this is ok

@jedi4ever

This comment has been minimized.

Show comment
Hide comment
@jedi4ever

jedi4ever Apr 16, 2012

Owner

@whren great work? any chance of a pull request? I love to get this integrated soon.

Owner

jedi4ever commented Apr 16, 2012

@whren great work? any chance of a pull request? I love to get this integrated soon.

@nigma

This comment has been minimized.

Show comment
Hide comment
@nigma

nigma Apr 16, 2012

Contributor

I have tested the fixes and it now works great on 1.9.3.

There's only a small issue in the checksum computation code (text vs binary mode) that I have referenced above.

I also gave it a try on a recent JRuby but it seems there are some platform-related bits missing from this particular ruby implementation (see http://pastebin.com/pscj4iM0). I guess that's out of scope for this project but it might be noted in the documentation.

Contributor

nigma commented Apr 16, 2012

I have tested the fixes and it now works great on 1.9.3.

There's only a small issue in the checksum computation code (text vs binary mode) that I have referenced above.

I also gave it a try on a recent JRuby but it seems there are some platform-related bits missing from this particular ruby implementation (see http://pastebin.com/pscj4iM0). I guess that's out of scope for this project but it might be noted in the documentation.

@jedi4ever

This comment has been minimized.

Show comment
Hide comment
@jedi4ever

jedi4ever Apr 16, 2012

Owner

Alright, all changes by @whren are now merged into master. Awesome work you guys! Let me know if I can close this issue or not.

Owner

jedi4ever commented Apr 16, 2012

Alright, all changes by @whren are now merged into master. Awesome work you guys! Let me know if I can close this issue or not.

@whren

This comment has been minimized.

Show comment
Hide comment
@whren

whren Apr 16, 2012

Contributor

you're welcome i was waiting for feedback before pulling this !

Contributor

whren commented Apr 16, 2012

you're welcome i was waiting for feedback before pulling this !

@jedi4ever

This comment has been minimized.

Show comment
Hide comment
@jedi4ever

jedi4ever Apr 18, 2012

Owner

hey guys, would it be ok to close the issue? Could you confirm all works?

thanks for all the feedback!

Owner

jedi4ever commented Apr 18, 2012

hey guys, would it be ok to close the issue? Could you confirm all works?

thanks for all the feedback!

@nigma

This comment has been minimized.

Show comment
Hide comment
@nigma

nigma Apr 18, 2012

Contributor

It works fine for me using the current master version on Windows 7 x64 and Ruby 1.9.3 with DevKit.

Great work, thanks!

Contributor

nigma commented Apr 18, 2012

It works fine for me using the current master version on Windows 7 x64 and Ruby 1.9.3 with DevKit.

Great work, thanks!

@charlesroper

This comment has been minimized.

Show comment
Hide comment
@charlesroper

charlesroper Apr 18, 2012

It's working great for me on my home Windows PC, but on my work box we're behind an ISA proxy and I get the following:

[C:\veewee]vagrant basebox build 'ubuntu1110'                                                                        
[ubuntu1110] Downloading vbox guest additions iso v 4.1.12 - http://download.virtualbox.org/virtualbox/4.1.12/VBoxGue
stAdditions_4.1.12.iso                                                                                               
[ubuntu1110] Creating an iso directory                                                                               
[ubuntu1110] Checking if isofile VBoxGuestAdditions_4.1.12.iso already exists.                                       
[ubuntu1110] Full path: C:/veewee/iso/VBoxGuestAdditions_4.1.12.iso                                                  
C:/Ruby/Ruby193/lib/ruby/1.9.1/open-uri.rb:346:in `open_http': 407 Proxy Authentication Required ( The ISA Server req
uires authorization to fulfill the request. Access to the Web Proxy service is denied.  ) (OpenURI::HTTPError)

[snipped]

I've got the HTTP_PROXY env var set along with a username and password. Is there something else I can do, or is this a bug? I thought Vagrant already handled proxies?

It's working great for me on my home Windows PC, but on my work box we're behind an ISA proxy and I get the following:

[C:\veewee]vagrant basebox build 'ubuntu1110'                                                                        
[ubuntu1110] Downloading vbox guest additions iso v 4.1.12 - http://download.virtualbox.org/virtualbox/4.1.12/VBoxGue
stAdditions_4.1.12.iso                                                                                               
[ubuntu1110] Creating an iso directory                                                                               
[ubuntu1110] Checking if isofile VBoxGuestAdditions_4.1.12.iso already exists.                                       
[ubuntu1110] Full path: C:/veewee/iso/VBoxGuestAdditions_4.1.12.iso                                                  
C:/Ruby/Ruby193/lib/ruby/1.9.1/open-uri.rb:346:in `open_http': 407 Proxy Authentication Required ( The ISA Server req
uires authorization to fulfill the request. Access to the Web Proxy service is denied.  ) (OpenURI::HTTPError)

[snipped]

I've got the HTTP_PROXY env var set along with a username and password. Is there something else I can do, or is this a bug? I thought Vagrant already handled proxies?

@jedi4ever

This comment has been minimized.

Show comment
Hide comment
@jedi4ever

jedi4ever Apr 18, 2012

Owner

I'm not sure on windows. could you try lowercase http_proxy ? The download is managed by veewee, not by vagrant (as it works independent of vagrant if needed)

Owner

jedi4ever commented Apr 18, 2012

I'm not sure on windows. could you try lowercase http_proxy ? The download is managed by veewee, not by vagrant (as it works independent of vagrant if needed)

@charlesroper

This comment has been minimized.

Show comment
Hide comment
@charlesroper

charlesroper Apr 18, 2012

I've just done a bit of digging and the following on StackOverflow shed some light:

http://stackoverflow.com/questions/10043046/ruby-proxy-authentication-get-post-with-openuri-or-net-http

If I specify the proxy, username and password as illustrated there, I can get through the proxy.

Where is the proxy handling code? I'll take a look at it.

I've just done a bit of digging and the following on StackOverflow shed some light:

http://stackoverflow.com/questions/10043046/ruby-proxy-authentication-get-post-with-openuri-or-net-http

If I specify the proxy, username and password as illustrated there, I can get through the proxy.

Where is the proxy handling code? I'll take a look at it.

@jedi4ever

This comment has been minimized.

Show comment
Hide comment
@jedi4ever

jedi4ever Apr 18, 2012

Owner

We could probably detect ourself if the environment variables are set. And add them to the download code. I think it's part of the iso.rb file.

Mind you this will only download the iso through the proxy. The box itself will need a proxy during the postinstall too.
Someone submitted a patch to have a pre_postinstall command specified in the definition.rb to have it execute before the posinstall scripts. That way you might be able to set the proxy correctly.

See also - http://www.aventinesolutions.nl/mediawiki/index.php/Quick_Tip:_Developer's_Environment_Behind_a_Proxy

Owner

jedi4ever commented Apr 18, 2012

We could probably detect ourself if the environment variables are set. And add them to the download code. I think it's part of the iso.rb file.

Mind you this will only download the iso through the proxy. The box itself will need a proxy during the postinstall too.
Someone submitted a patch to have a pre_postinstall command specified in the definition.rb to have it execute before the posinstall scripts. That way you might be able to set the proxy correctly.

See also - http://www.aventinesolutions.nl/mediawiki/index.php/Quick_Tip:_Developer's_Environment_Behind_a_Proxy

@charlesroper

This comment has been minimized.

Show comment
Hide comment
@charlesroper

charlesroper Apr 18, 2012

It was @whren that submitted the pre_postinstall patch. I can't quite see how it's used - I was hoping there would be a demo file as there is with the others, but there doesn't appear to be. It should go in the definitions directory, right? Hopefully @whren will see this and enlighten us. :)

I can report that hacking the iso.rb to the following got it downloading. So if there were some code to parse the HTTP_PROXY var, that would work.

            proxy_uri = URI.parse("http://proxy_address:8088")
            pbar = nil
            URI.parse(url).open(
              :content_length_proc => lambda {|t|
              if t && 0 < t
                pbar = ProgressBar.new("Fetching file", t)
                pbar.file_transfer_mode
              end
            },
              :progress_proc => lambda {|s|
              pbar.set s if pbar
            }, :proxy_http_basic_authentication => [proxy_uri, "MYUSERNAME", "MYPASSWORD"]) { |src|
              # We assume large 10K files, so this is tempfile object
              env.logger.info "#{src.class}"
                ui.info "Moving #{src.path} to #{localfile}"
                # Force the close of the src stream to release handle before moving
                # Not forcing the close may cause an issue on windows (Permission Denied)
                src.close
                FileUtils.mv(src.path,localfile)
                #open(localfile,"wb") { |dst|
                  #dst.write(src.read)
                #}
            }
          end

It was @whren that submitted the pre_postinstall patch. I can't quite see how it's used - I was hoping there would be a demo file as there is with the others, but there doesn't appear to be. It should go in the definitions directory, right? Hopefully @whren will see this and enlighten us. :)

I can report that hacking the iso.rb to the following got it downloading. So if there were some code to parse the HTTP_PROXY var, that would work.

            proxy_uri = URI.parse("http://proxy_address:8088")
            pbar = nil
            URI.parse(url).open(
              :content_length_proc => lambda {|t|
              if t && 0 < t
                pbar = ProgressBar.new("Fetching file", t)
                pbar.file_transfer_mode
              end
            },
              :progress_proc => lambda {|s|
              pbar.set s if pbar
            }, :proxy_http_basic_authentication => [proxy_uri, "MYUSERNAME", "MYPASSWORD"]) { |src|
              # We assume large 10K files, so this is tempfile object
              env.logger.info "#{src.class}"
                ui.info "Moving #{src.path} to #{localfile}"
                # Force the close of the src stream to release handle before moving
                # Not forcing the close may cause an issue on windows (Permission Denied)
                src.close
                FileUtils.mv(src.path,localfile)
                #open(localfile,"wb") { |dst|
                  #dst.write(src.read)
                #}
            }
          end

@whren

This comment has been minimized.

Show comment
Hide comment
@whren

whren Apr 18, 2012

Contributor

Look here on how to use pre_postinstall hook : https://github.com/whren/veewee/wiki/Use-of-pre_postinstall_file-in-definition.rb
Let me know if you need more informations

Contributor

whren commented Apr 18, 2012

Look here on how to use pre_postinstall hook : https://github.com/whren/veewee/wiki/Use-of-pre_postinstall_file-in-definition.rb
Let me know if you need more informations

@charlesroper

This comment has been minimized.

Show comment
Hide comment
@charlesroper

charlesroper Apr 19, 2012

Thanks @whren that's really helpful.

I've come across another problem now when doing basebox export. It gets to the compression stage, then chokes on an Encoding::ConversionError. Any ideas on what would be causing this?

[ubuntu1110] Compressing package to: C:/Users/charlesr/veewee/ubuntu1110.box
C:/Users/charlesr/Tools/Ruby192/lib/ruby/gems/1.9.1/gems/archive-tar-minitar-0.5.2/lib/archive/tar/minitar.rb:280:in `write': "\xE0" to UTF-8 in conversion from ASCII-8BIT to UTF-8 to CP850 (Encoding::UndefinedConversionError)

Thanks @whren that's really helpful.

I've come across another problem now when doing basebox export. It gets to the compression stage, then chokes on an Encoding::ConversionError. Any ideas on what would be causing this?

[ubuntu1110] Compressing package to: C:/Users/charlesr/veewee/ubuntu1110.box
C:/Users/charlesr/Tools/Ruby192/lib/ruby/gems/1.9.1/gems/archive-tar-minitar-0.5.2/lib/archive/tar/minitar.rb:280:in `write': "\xE0" to UTF-8 in conversion from ASCII-8BIT to UTF-8 to CP850 (Encoding::UndefinedConversionError)
@tlpinney

This comment has been minimized.

Show comment
Hide comment
@tlpinney

tlpinney Apr 20, 2012

I am getting a similar error

Users/tlpinney/.rvm/gems/ruby-1.9.3-p0/gems/archive-tar-minitar-0.5.2/lib/archive/tar/minitar.rb:280:in 'write': "\x80" from ASCII-8BIT to UTF-8 (Encoding::UndefinedConversionError)

I am getting a similar error

Users/tlpinney/.rvm/gems/ruby-1.9.3-p0/gems/archive-tar-minitar-0.5.2/lib/archive/tar/minitar.rb:280:in 'write': "\x80" from ASCII-8BIT to UTF-8 (Encoding::UndefinedConversionError)

@jedi4ever

This comment has been minimized.

Show comment
Hide comment
@jedi4ever

jedi4ever Apr 20, 2012

Owner

Hmm. I recently introduced some UTF-8 setting in the Gemfile.

https://github.com/jedi4ever/veewee/blob/master/Gemfile

Could you try to remove that section, and see if this improves things?

Owner

jedi4ever commented Apr 20, 2012

Hmm. I recently introduced some UTF-8 setting in the Gemfile.

https://github.com/jedi4ever/veewee/blob/master/Gemfile

Could you try to remove that section, and see if this improves things?

@tlpinney

This comment has been minimized.

Show comment
Hide comment
@tlpinney

tlpinney Apr 20, 2012

That worked for me removing it

That worked for me removing it

@tlpinney

This comment has been minimized.

Show comment
Hide comment
@tlpinney

tlpinney Apr 20, 2012

I am on Mac OSX 10.6 using ruby 1.9.3 with rvm

I am on Mac OSX 10.6 using ruby 1.9.3 with rvm

@charlesroper

This comment has been minimized.

Show comment
Hide comment
@charlesroper

charlesroper Apr 20, 2012

Yes, removing it worked for me too on ruby 1.9.3p0 (2011-10-30) [i386-mingw32].

[C:\veewee]bundle exec vagrant basebox export ubuntu1110                                                                                                                                                                                        
[ubuntu1110] Executing vagrant voodoo:                                                                                                                                                                                                          
[ubuntu1110] vagrant package --base 'ubuntu1110' --output 'ubuntu1110.box'                                                                                                                                                                      
[ubuntu1110]                                                                                                                                                                                                                                    
[ubuntu1110] To import it into vagrant type:                                                                                                                                                                                                    
[ubuntu1110] vagrant box add 'ubuntu1110' 'ubuntu1110.box'                                                                                                                                                                                      
[ubuntu1110]                                                                                                                                                                                                                                    
[ubuntu1110] To use it:                                                                                                                                                                                                                         
[ubuntu1110] vagrant init 'ubuntu1110'                                                                                                                                                                                                          
[ubuntu1110] vagrant up                                                                                                                                                                                                                         
[ubuntu1110] vagrant ssh  

Yes, removing it worked for me too on ruby 1.9.3p0 (2011-10-30) [i386-mingw32].

[C:\veewee]bundle exec vagrant basebox export ubuntu1110                                                                                                                                                                                        
[ubuntu1110] Executing vagrant voodoo:                                                                                                                                                                                                          
[ubuntu1110] vagrant package --base 'ubuntu1110' --output 'ubuntu1110.box'                                                                                                                                                                      
[ubuntu1110]                                                                                                                                                                                                                                    
[ubuntu1110] To import it into vagrant type:                                                                                                                                                                                                    
[ubuntu1110] vagrant box add 'ubuntu1110' 'ubuntu1110.box'                                                                                                                                                                                      
[ubuntu1110]                                                                                                                                                                                                                                    
[ubuntu1110] To use it:                                                                                                                                                                                                                         
[ubuntu1110] vagrant init 'ubuntu1110'                                                                                                                                                                                                          
[ubuntu1110] vagrant up                                                                                                                                                                                                                         
[ubuntu1110] vagrant ssh  
@jedi4ever

This comment has been minimized.

Show comment
Hide comment
@jedi4ever

jedi4ever Apr 20, 2012

Owner

@charlesroper @tlpinney I reverted the changes on UTF-8 and need to find a better workaround for the problem I had with it. Thanks for the feedback.

Owner

jedi4ever commented Apr 20, 2012

@charlesroper @tlpinney I reverted the changes on UTF-8 and need to find a better workaround for the problem I had with it. Thanks for the feedback.

@johnyesberg

This comment has been minimized.

Show comment
Hide comment
@johnyesberg

johnyesberg May 28, 2012

I just learned about veewee & vagrant recently. My host OS is Windows 7, and I want to run Windows Server 2008R2 guests. I wrote about my experiences trying to get veewee running on my blog at http://joannaandjohn.blogspot.com.au/2012/05/windows-development-vms-long-adventure.html

The main problems I found were to do with paths under Cygwin. For example, I saw this error:
VBoxManage.exe: error: Could not find file for the medium 'C:\cygdrive\c\Users\John\repos\veewee\iso\en_windows_server_2008_r2_standard_enterprise_datacenter_web_x64_dvd_x15-50365.iso'

The real path should have been c:\Users\John\repos\veewee\iso\en_windows_server_2008_r2_standard_enterprise_datacenter_web_x64_dvd_x15-50365.iso

I made changes to a couple of files to fix this:
veewee/lib/veewee/provider/virtualbox/box/helper/create.rb
veewee/lib/veewee/provider/core/box/floppy.rb

I saw errors like this:

Unable to access jarfile C:UsersJohnreposveeweelibjavadir2floppy.jar

It seemed that Java was devouring an extra backslash. So I added another method escape to floppy.rb.

       def escape(s)
         s.gsub('\\','\\\\\\\\')
       end

Things I'd like to do next:

  • add a config step to attach/mount a directory from my host on my new vm that contains the cygwin local repository. This will avoid the need to download stacks of cygwin for each vm I create.
  • add tests for my existing code. (I'm not fluent with ruby yet.)

My repo is at https://github.com/johnyesberg/veewee.

I just learned about veewee & vagrant recently. My host OS is Windows 7, and I want to run Windows Server 2008R2 guests. I wrote about my experiences trying to get veewee running on my blog at http://joannaandjohn.blogspot.com.au/2012/05/windows-development-vms-long-adventure.html

The main problems I found were to do with paths under Cygwin. For example, I saw this error:
VBoxManage.exe: error: Could not find file for the medium 'C:\cygdrive\c\Users\John\repos\veewee\iso\en_windows_server_2008_r2_standard_enterprise_datacenter_web_x64_dvd_x15-50365.iso'

The real path should have been c:\Users\John\repos\veewee\iso\en_windows_server_2008_r2_standard_enterprise_datacenter_web_x64_dvd_x15-50365.iso

I made changes to a couple of files to fix this:
veewee/lib/veewee/provider/virtualbox/box/helper/create.rb
veewee/lib/veewee/provider/core/box/floppy.rb

I saw errors like this:

Unable to access jarfile C:UsersJohnreposveeweelibjavadir2floppy.jar

It seemed that Java was devouring an extra backslash. So I added another method escape to floppy.rb.

       def escape(s)
         s.gsub('\\','\\\\\\\\')
       end

Things I'd like to do next:

  • add a config step to attach/mount a directory from my host on my new vm that contains the cygwin local repository. This will avoid the need to download stacks of cygwin for each vm I create.
  • add tests for my existing code. (I'm not fluent with ruby yet.)

My repo is at https://github.com/johnyesberg/veewee.

@thedrow

This comment has been minimized.

Show comment
Hide comment
@thedrow

thedrow May 29, 2012

@johnyesberg Could you create a pull request with the changes you've made?

thedrow commented May 29, 2012

@johnyesberg Could you create a pull request with the changes you've made?

@nicoulaj

This comment has been minimized.

Show comment
Hide comment
@nicoulaj

nicoulaj Sep 25, 2012

vagrant gem install veewee doesn't seem to work on Windows, what is the right method ?

Microsoft Windows [version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. Tous droits réservés.

C:\Users\nicoulaj>vagrant gem install veewee
Fetching: archive-tar-minitar-0.5.2.gem (100%)
Fetching: ffi-1.0.11.gem (100%)
Temporarily enhancing PATH to include DevKit...
Building native extensions.  This could take a while...
ERROR:  Error installing veewee:
        ERROR: Failed to build gem native extension.

        C:/vagrant/vagrant/embedded/bin/ruby.exe extconf.rb
checking for ffi.h... *** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers.  Check the mkmf.log file for more
details.  You may need configuration options.

Provided configuration options:
        --with-opt-dir
        --without-opt-dir
        --with-opt-include
        --without-opt-include=${opt-dir}/include
        --with-opt-lib
        --without-opt-lib=${opt-dir}/lib
        --with-make-prog
        --without-make-prog
        --srcdir=.
        --curdir
        --ruby=C:/vagrant/vagrant/embedded/bin/ruby
        --with-ffi_c-dir
        --without-ffi_c-dir
        --with-ffi_c-include
        --without-ffi_c-include=${ffi_c-dir}/include
        --with-ffi_c-lib
        --without-ffi_c-lib=${ffi_c-dir}/lib
        --with-libffi-config
        --without-libffi-config
        --with-pkg-config
        --without-pkg-config
C:/vagrant/vagrant/embedded/lib/ruby/1.9.1/mkmf.rb:381:in `try_do': The compiler failed to generate
an executable file. (RuntimeError)
You have to install development tools first.
        from C:/vagrant/vagrant/embedded/lib/ruby/1.9.1/mkmf.rb:506:in `try_cpp'
        from C:/vagrant/vagrant/embedded/lib/ruby/1.9.1/mkmf.rb:931:in `block in have_header'
        from C:/vagrant/vagrant/embedded/lib/ruby/1.9.1/mkmf.rb:790:in `block in checking_for'
        from C:/vagrant/vagrant/embedded/lib/ruby/1.9.1/mkmf.rb:284:in `block (2 levels) in postpone'
        from C:/vagrant/vagrant/embedded/lib/ruby/1.9.1/mkmf.rb:254:in `open'
        from C:/vagrant/vagrant/embedded/lib/ruby/1.9.1/mkmf.rb:284:in `block in postpone'
        from C:/vagrant/vagrant/embedded/lib/ruby/1.9.1/mkmf.rb:254:in `open'
        from C:/vagrant/vagrant/embedded/lib/ruby/1.9.1/mkmf.rb:280:in `postpone'
        from C:/vagrant/vagrant/embedded/lib/ruby/1.9.1/mkmf.rb:789:in `checking_for'
        from C:/vagrant/vagrant/embedded/lib/ruby/1.9.1/mkmf.rb:930:in `have_header'
        from extconf.rb:9:in `<main>'

Gem files will remain installed in P:/.vagrant.d/gems/gems/ffi-1.0.11 for inspection.
Results logged to P:/.vagrant.d/gems/gems/ffi-1.0.11/ext/ffi_c/gem_make.out

vagrant gem install veewee doesn't seem to work on Windows, what is the right method ?

Microsoft Windows [version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. Tous droits réservés.

C:\Users\nicoulaj>vagrant gem install veewee
Fetching: archive-tar-minitar-0.5.2.gem (100%)
Fetching: ffi-1.0.11.gem (100%)
Temporarily enhancing PATH to include DevKit...
Building native extensions.  This could take a while...
ERROR:  Error installing veewee:
        ERROR: Failed to build gem native extension.

        C:/vagrant/vagrant/embedded/bin/ruby.exe extconf.rb
checking for ffi.h... *** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers.  Check the mkmf.log file for more
details.  You may need configuration options.

Provided configuration options:
        --with-opt-dir
        --without-opt-dir
        --with-opt-include
        --without-opt-include=${opt-dir}/include
        --with-opt-lib
        --without-opt-lib=${opt-dir}/lib
        --with-make-prog
        --without-make-prog
        --srcdir=.
        --curdir
        --ruby=C:/vagrant/vagrant/embedded/bin/ruby
        --with-ffi_c-dir
        --without-ffi_c-dir
        --with-ffi_c-include
        --without-ffi_c-include=${ffi_c-dir}/include
        --with-ffi_c-lib
        --without-ffi_c-lib=${ffi_c-dir}/lib
        --with-libffi-config
        --without-libffi-config
        --with-pkg-config
        --without-pkg-config
C:/vagrant/vagrant/embedded/lib/ruby/1.9.1/mkmf.rb:381:in `try_do': The compiler failed to generate
an executable file. (RuntimeError)
You have to install development tools first.
        from C:/vagrant/vagrant/embedded/lib/ruby/1.9.1/mkmf.rb:506:in `try_cpp'
        from C:/vagrant/vagrant/embedded/lib/ruby/1.9.1/mkmf.rb:931:in `block in have_header'
        from C:/vagrant/vagrant/embedded/lib/ruby/1.9.1/mkmf.rb:790:in `block in checking_for'
        from C:/vagrant/vagrant/embedded/lib/ruby/1.9.1/mkmf.rb:284:in `block (2 levels) in postpone'
        from C:/vagrant/vagrant/embedded/lib/ruby/1.9.1/mkmf.rb:254:in `open'
        from C:/vagrant/vagrant/embedded/lib/ruby/1.9.1/mkmf.rb:284:in `block in postpone'
        from C:/vagrant/vagrant/embedded/lib/ruby/1.9.1/mkmf.rb:254:in `open'
        from C:/vagrant/vagrant/embedded/lib/ruby/1.9.1/mkmf.rb:280:in `postpone'
        from C:/vagrant/vagrant/embedded/lib/ruby/1.9.1/mkmf.rb:789:in `checking_for'
        from C:/vagrant/vagrant/embedded/lib/ruby/1.9.1/mkmf.rb:930:in `have_header'
        from extconf.rb:9:in `<main>'

Gem files will remain installed in P:/.vagrant.d/gems/gems/ffi-1.0.11 for inspection.
Results logged to P:/.vagrant.d/gems/gems/ffi-1.0.11/ext/ffi_c/gem_make.out
@PierreR

This comment has been minimized.

Show comment
Hide comment
@PierreR

PierreR Oct 17, 2012

For info, ffi 1.0.11 does not build on my machine (Windows 7 with local ruby 1.8.7) using:

gem install -v 1.0.11 ffi

The current version of veewee seems to require that specific version of ffi. Hence gem install veewee fails

I can build latest versions (1.1.4 or 1.1.5) of ffi without problem.

PierreR commented Oct 17, 2012

For info, ffi 1.0.11 does not build on my machine (Windows 7 with local ruby 1.8.7) using:

gem install -v 1.0.11 ffi

The current version of veewee seems to require that specific version of ffi. Hence gem install veewee fails

I can build latest versions (1.1.4 or 1.1.5) of ffi without problem.

@jedi4ever

This comment has been minimized.

Show comment
Hide comment
@jedi4ever

jedi4ever Nov 5, 2012

Owner

@PierreR can try adding the ffi version to the gemspec file and see if this works?

Owner

jedi4ever commented Nov 5, 2012

@PierreR can try adding the ffi version to the gemspec file and see if this works?

@jedi4ever

This comment has been minimized.

Show comment
Hide comment
@jedi4ever

jedi4ever Feb 18, 2013

Owner

@PierreR any news?

Owner

jedi4ever commented Feb 18, 2013

@PierreR any news?

@jedi4ever jedi4ever closed this Feb 21, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment