카테고리 없음

Vagrant Synced Folder

박작가 2022. 3. 3. 22:27

Vagrant으로 virtualbox vm의 lifecycle을 관리한다. 

host의 특정 폴더를 vm에 공유하기 위해서 vagrant를 synced folder를 설정해서 사용한다. 

 

https://www.vagrantup.com/docs/synced-folders/basic_usage

 

Basic Usage - Synced Folders | Vagrant by HashiCorp

Synced folders are configured within your Vagrantfile using the "config.vm.synced_folder" method.

www.vagrantup.com

막상 호스트의 2TB 외장하드를 몽땅 synced folder로 vm에 공유하려니 왠지 걱정이됐다. '혹시 파일 전체를 복사하면 어쩌지?'

 

Vagrant 문서를 좀 더 읽어보니 Vagrant VirtualBox 프로바이더를 사용하면 syced folder 타입은 기본적으로 'VirtualBox' 타입을 사용한다고 적혀있고 'VirtualBox' 타입의 synced folder는 VirtualBox의 공유폴더(Shared Folder) 시스템을 이용한다고 적혀있다. 

 

https://www.vagrantup.com/docs/synced-folders/virtualbox

 

VirtualBox Shared Folders - Synced Folders | Vagrant by HashiCorp

If you are using the Vagrant VirtualBox provider, then VirtualBox shared folders are the default synced folder type. These synced folders use the VirtualBox shared folder system to sync file changes from the guest to the host and vice versa.

www.vagrantup.com

아래 VirtualBox 문서를 읽어보니 VirtualBox 공유폴더는 네트워크 파일 공유와 유사하며 Guest Addition의 특별한 파일 시스템으로 단지 host의 폴더를 vm에 공유한다고 적혀있다. 

 

https://docs.oracle.com/en/virtualization/virtualbox/6.0/user/sharedfolders.html

 

4.3. Shared Folders

With the shared folders feature of Oracle VM VirtualBox, you can access files of your host system from within the guest system. This is similar to how you would use network shares in Windows networks, except that shared folders do not require networking, o

docs.oracle.com

 

테스트 해보니 다행히 단순 폴더 공유였다. 파일을 복제하지는 않았다. 괜한 기우였다.