Vagrantノート


Vagrantがboxファイルをインポート中に認証に失敗しました
 default: SSH auth method: private key
 default: Warning: Remote connection disconnect. Retrying...
 default: Warning: Remote connection disconnect. Retrying...
 default: Warning: Authentication failure. Retrying...

ネットで検索した2つの方法
  Vagrantfile
     
config.ssh.username = "vagrant"
config.ssh.password = "vagrant"
            ,   login key    
     ,     ,   
# config.ssh.username = "vagrant"
# config.ssh.password = "vagrant"
a.        ssh-keygen
                 ,         ,   SSH key      ~/.ssh/id_rsa;
b.ssh-add ~/.ssh/id_rsa        ;
c. Vagrantfile    
config.ssh.private_key_path = “~/.ssh/id_rsa”
config.ssh.forward_agent = true
  vagrant ssh    
d.    ~/.ssh/authorized_keys         ”~/.ssh/id_rsa.pub”       ;
e.vagant reload             

Vagrant VirtualBox Guest Additionsを最新バージョンに更新
最新バージョン(5.1)にVirtualboxをアップグレードした後、up時にVirtualBox Guest Additionsバージョンが現在のVirtualboxバージョンより低いことを提示します.vagrantプラグインを1つインストールすれば起動できるときにVirtualBox Guest Additionsを自動的に最新に更新します.vagrant plugin install vagrant-vbguest
https://coderwall.com/p/mvf0a...


デフォルトの共有設定所有者、所属グループ、およびファイル権限
VagrantfileのデフォルトではVirtualboxの共有が使用されているため、仮想マシンにログインした後のアクセス権は777になります.変更した場合は、次の構成を使用できます.
    config.vm.synced_folder "../Code", "/srv/code",
      :owner: "www", :group: "www", #              
      :mount_options => ["dmode=775", "fmode=664"] #      

ここで質問ですが、デフォルトではvagrantを使用してログインしていますが、マウントされたディレクトリで操作すると、vagrantをwwwユーザーグループに追加したりrootにカットしたりすることができます.
NFSの設定
Winでnfsを使ってもあまり速く感じられず、現在ではデフォルトの共有で十分です.
*    nfs  `vagrant plugin install vagrant-winnfsd`
*   Vagrantfile  
  config.vm.synced_folder "../Code", "/srv/code", type: "nfs" #    nfs  
  config.nfs.map_uid = 1002 #          id,  www 1002
  config.nfs.map_gid = 1002
>     https://www.vagrantup.com/docs/synced-folders/nfs.html

PS:以上の設定を押すだけで仮想マシン内のフォルダとファイル権限は777になり、デフォルト共有のようにmount_optionsで設定する方法がわかりません