php - Cannot access vagrant vm from the host machine -
i've set vagrant virtual box puphpet running fine (in ubuntu 14.04) , i'm able connect via ssh. i've used vagrant hostmanager vm's ip automatically added hosts file.
this hosts file:
127.0.0.1 localhost 127.0.1.1 pcuser-hp-elitebook-8470p # following lines desirable ipv6 capable hosts ::1 ip6-localhost ip6-loopback fe00::0 ip6-localnet ff00::0 ip6-mcastprefix ff02::1 ip6-allnodes ff02::2 ip6-allrouters ## vagrant-hostmanager-start id: 2314dd30-24cf-4122-8779-8b755f5e6186 172.22.22.22 projectname.local 172.22.22.22 www.projectname.local ## vagrant-hostmanager-end ## vagrant-hostmanager-start id: c20d4d7f-3ada-4b2a-b142-e44826571754 192.168.56.101 machine1.puphpet 192.168.56.101 symfony.dev ## vagrant-hostmanager-end
the problem when try access vm host either through ip address or through virtual host server name i've set (symfony.dev).
either time it's unable connect it, although i've pinged machine ip host , it's responding fine.
at first didn't have vagrant hostmanager installed , added ip , virtual host server name (symfony.dev) manually hosts file wasn't able connect.
i've checked settings in config.yaml file , seem fine:
vagrantfile: target: local vm: provider: local: box: puphpet/ubuntu1404-x64 box_url: puphpet/ubuntu1404-x64 box_version: '0' chosen_virtualizer: virtualbox virtualizers: virtualbox: modifyvm: natdnshostresolver1: false showgui: 0 vmware: numvcpus: 1 parallels: linked_clone: 0 check_guest_tools: 0 update_guest_tools: 0 machines: vflm_zaw8al7jczu3: id: machine1 hostname: machine1.puphpet network: private_network: 192.168.56.101 forwarded_port: vflmnfp_67om22p4f0j3: host: '5608' guest: '22' memory: '1024' cpus: '1' provision: puppet: manifests_path: puphpet/puppet/manifests module_path: - puphpet/puppet/modules - puphpet/puppet/manifests options: - '--verbose' - '--hiera_config /vagrant/puphpet/puppet/hiera.yaml' synced_folder: vflsf_y5mnuhi3ihqh: source: ./ target: /var/www sync_type: nfs smb: smb_host: '' smb_username: '' smb_password: '' mount_options: dir_mode: '0775' file_mode: '0664' rsync: args: - '--verbose' - '--archive' - '-z' exclude: - .vagrant/ - .git/ auto: 'true' owner: www-data group: www-data usable_port_range: start: 10200 stop: 10500 post_up_message: ''
do need change in configuration or missing or doing wrong?
any appreciated.
you start server bound 127.0.0.1 / localhost ip accessible vm
you need start using ip of vm or 0.0.0.0 ip. should work
php bin/console server:start 0.0.0.0:8000
Comments
Post a Comment