jedi4ever / veewee

Easing the building of vagrant boxes
MIT License
4.29k stars 779 forks source link

Creating VM with KVM #1026

Closed kashif74 closed 9 years ago

kashif74 commented 9 years ago

I am trying to create a KVM based VM and having issue with networking. I tried ubuntu-11.04 and it is failing with this error veewee/lib/veewee/provider/core/helper/web.rb:81:in rescue in server_for_http_request': undefined local variable or methodserver' for #Veewee::Provider::Kvm::Box:0x007f62a8d62c18 (NameError) There seems to be some issue with iptable ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED ACCEPT icmp -- anywhere anywhere
ACCEPT all -- anywhere anywhere
ACCEPT tcp -- anywhere anywhere tcp dpt:7122 ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:ssh REJECT all -- anywhere anywhere reject-with icmp-host-prohibited

Chain FORWARD (policy ACCEPT) target prot opt source destination
REJECT all -- anywhere anywhere reject-with icmp-host-prohibited

Chain OUTPUT (policy ACCEPT) target prot opt source destination

I have opened port 7122 for web server.

mpapis commented 9 years ago
  1. what version of veewee is this?
  2. please gist the whole stack trace/error
kashif74 commented 9 years ago

Hi I am using veewee v0.4.5.1 on a fedora 20 machine. Using rbenv with ruby version ruby 2.0.0p598. Used following command to build VM bundle exec veewee kvm build ubuntutest11 --network-name default --debug --force

I have created gist for error and definition file https://gist.github.com/kashif74/73374bf28c44b6f78f8f

I can open vm with virt-manager and it is failing with this error " Network autoconfiguration failed Your network is probably not using the DHCP protocol. Alternatively the DHCP server may be slow or some network hardware is not working properly"

mpapis commented 9 years ago

does the same happens with 0.5.0.alpha4?

kashif74 commented 9 years ago

Hi I tried 0.5.0.alpha4 in seperate rbenv but could not manage to install. It failed with this error

warning: ignoring extraneous ruby-' prefix in versionruby-1.9.3-p547' (set by /home/mohammad/newvee/veewee/.ruby-version) There was a NoMethodError while loading veewee.gemspec: undefined method metadata=' for #<Gem::Specification name=veewee version=0.5.0.alpha4> from /home/mohammad/newvee/veewee/veewee.gemspec:59:inblock in

'

mpapis commented 9 years ago

please run in that ruby gem update --system - and try again

kashif74 commented 9 years ago

Sorry, I closed the ticket by mistake. Updated to 0.5.0.alpha4 after updating gem as suggested by you. Creating VM failed again although error is more specific this time "are you using firewall blocking connections to port: 7122? (RuntimeError)" I have updated https://gist.github.com/kashif74/73374bf28c44b6f78f8f with new errors

I can not see any problem with iptables. I have updated verbose output of iptable to gist as well. I tried connecting to port 7122 from a different machine when web server was running and I got connected to it. Thanks

mpapis commented 9 years ago

can you gist full error output from 0.5.0.alpha4 - I also can not find the iptables verbose output.

kashif74 commented 9 years ago

Sorry https://gist.github.com/kashif74/73374bf28c44b6f78f8f

mpapis commented 9 years ago

maybe it's not firewall but routing problem:

  1. can you check from another KVM VM if you can ping the port?
  2. maybe it's configuration of the VM that fails?
  3. maybe some of the options fail for ubuntu itself, can you test it with virtualbox?
kashif74 commented 9 years ago

Thanks for the pointer. It was the firewall problem. Restarting libvirtd opened ports for dhcp and I have to open port 7122 manually.