{
    "componentChunkName": "component---src-templates-blog-post-js",
    "path": "/docs/configuring-vm/",
    "result": {"data":{"site":{"siteMetadata":{"title":"Linuxdev Documentation","social":{"disqusShortName":"kennyyeoyounet"}}},"markdownRemark":{"id":"bdeda9f4-e066-5cbb-8d3e-d5bc814c0e13","excerpt":"Configuring the VM You can create .env to customize the VM environment. Bootstrap interactively inputs the required values with some default values. Interactive…","html":"<h1 id=\"configuring-the-vm\" style=\"position:relative;\" class=\"title\"><a href=\"#configuring-the-vm\" aria-label=\"configuring the vm permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Configuring the VM</h1>\n<p>You can create .env to customize the VM environment. Bootstrap interactively inputs the required values with some default values.</p>\n<h2 id=\"interactive-variables\" style=\"position:relative;\" class=\"subtitle\"><a href=\"#interactive-variables\" aria-label=\"interactive variables permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Interactive Variables</h2>\n<p>They have default values and are asked during bootstrap.sh and saved so it’s not asked again.</p>\n<h3 id=\"name\" style=\"position:relative;\"><a href=\"#name\" aria-label=\"name permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Name</h3>\n<p>Machine name</p>\n<div class=\"gatsby-highlight\" data-language=\"text\"><pre class=\"language-text\"><code class=\"language-text\">NAME=awesome-name</code></pre></div>\n<p>This will rename the machine name in VirtualBox. run <code class=\"language-text\">vagrant reload</code> to apply when updated.</p>\n<p>It will also set the hostname of VM</p>\n<h3 id=\"cpus-and-memory\" style=\"position:relative;\"><a href=\"#cpus-and-memory\" aria-label=\"cpus and memory permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Cpus and memory</h3>\n<div class=\"gatsby-highlight\" data-language=\"text\"><pre class=\"language-text\"><code class=\"language-text\">CPUS=4\nMEMORY=8192</code></pre></div>\n<p>This will adjust cpus and memory, run <code class=\"language-text\">vagrant reload</code> to apply when updated.</p>\n<h3 id=\"vagrant-username\" style=\"position:relative;\"><a href=\"#vagrant-username\" aria-label=\"vagrant username permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Vagrant Username</h3>\n<div class=\"gatsby-highlight\" data-language=\"text\"><pre class=\"language-text\"><code class=\"language-text\">EXPAND_DISK_GB=10</code></pre></div>\n<h3 id=\"dotfiles-repo\" style=\"position:relative;\"><a href=\"#dotfiles-repo\" aria-label=\"dotfiles repo permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Dotfiles Repo</h3>\n<div class=\"gatsby-highlight\" data-language=\"text\"><pre class=\"language-text\"><code class=\"language-text\">DOTFILES_REPO=https://github.com/kennyhyun/dotfiles.git</code></pre></div>\n<p>This will make bootstrap continue to set VM environment using this external script repo</p>\n<p>** This has no default variable</p>\n<h2 id=\"optional-variables\" style=\"position:relative;\" class=\"subtitle\"><a href=\"#optional-variables\" aria-label=\"optional variables permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Optional Variables</h2>\n<p>it’s not saved automatically but you can manually add by editing .env file</p>\n<h3 id=\"expand-disk-size\" style=\"position:relative;\"><a href=\"#expand-disk-size\" aria-label=\"expand disk size permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Expand disk size</h3>\n<div class=\"gatsby-highlight\" data-language=\"text\"><pre class=\"language-text\"><code class=\"language-text\">EXPAND_DISK_GB=10</code></pre></div>\n<p>It’s using 60GB of disk image but it’s dynamically allocated.\nIt’s is great in most case but when the disk space is expanded, the VM performance will be deteriorated.</p>\n<p>This will expand the disk during bootstrap.\nAnd you will have some slowness on the VM for a while but would not be slow while using the VM afterwhile.</p>\n<p>This should be setup before running bootstrap.\nOr you can retry after removing <code class=\"language-text\">/dummy</code></p>\n<h3 id=\"docker-lib-disk\" style=\"position:relative;\"><a href=\"#docker-lib-disk\" aria-label=\"docker lib disk permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Docker lib disk</h3>\n<div class=\"gatsby-highlight\" data-language=\"text\"><pre class=\"language-text\"><code class=\"language-text\">DOCKER_DISK_SIZE_GB=45</code></pre></div>\n<p>This creates a dedicated docker disk and mount to <code class=\"language-text\">/var/lib/docker</code></p>\n<p>This uses a <strong>Fixed</strong> size disk image for the performance, so please check the free space before setting this.\nThere is a startup script to check empty disk partition and format to utilise as a docker disk.\nIf you want to change the size, shutdown the VM and remove the image and delete existing, and change this and start the VM. Please note any data in the container <strong>will be gone</strong> with the previous disk image.</p>\n<p>Please note that creating a fixed size image can take a few minutes, but maybe longer in Mac (like an hour). Please be patience.</p>\n<p>This has no default value so it uses the dynamic sized system disk image (maximum 60GB).</p>\n<p>If you had some data left in the system disk docker libs, you can see that by 1. stop docker, 2. unmounting /var/lib/docker, 3. start docker again. You can also delete that after unmounting if you don’t need that any more.</p>\n<h3 id=\"docker-compose-version\" style=\"position:relative;\"><a href=\"#docker-compose-version\" aria-label=\"docker compose version permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>docker-compose version</h3>\n<div class=\"gatsby-highlight\" data-language=\"text\"><pre class=\"language-text\"><code class=\"language-text\">COMPOSE_VERSION=1.29.2</code></pre></div>\n<p>Downloads docker-compose from <code class=\"language-text\">https://github.com/docker/compose/releases/download/\\${dc_version}/docker-compose-$(uname -s)-$(uname -m)</code></p>\n<h3 id=\"share-host-directories\" style=\"position:relative;\"><a href=\"#share-host-directories\" aria-label=\"share host directories permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Share host directories</h3>\n<p>You can add shared directory by envionment variables. You will need to <code class=\"language-text\">vagrat reload</code></p>\n<div class=\"gatsby-highlight\" data-language=\"text\"><pre class=\"language-text\"><code class=\"language-text\">HOST_PATHS=~/Projects,C:\\ProgramData</code></pre></div>\n<p>If you use <strong>docker</strong> in the host OS and binding volumes, the source volume should be in the HOST_PATHS</p>\n<p>If the path does not exist, it creates a blank directory and shares</p>\n<h3 id=\"setting-vm-environment-variables\" style=\"position:relative;\"><a href=\"#setting-vm-environment-variables\" aria-label=\"setting vm environment variables permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Setting VM environment variables</h3>\n<p>If you want to set VM environment variables by the host .env file, use <code class=\"language-text\">__VM__</code> prefix</p>\n<div class=\"gatsby-highlight\" data-language=\"text\"><pre class=\"language-text\"><code class=\"language-text\">__VM__VERSION=1.2.3</code></pre></div>\n<p>Will set</p>\n<div class=\"gatsby-highlight\" data-language=\"text\"><pre class=\"language-text\"><code class=\"language-text\">VERSION=1.2.3</code></pre></div>\n<p>in the VM</p>\n<p>** __VM__ZSH_THEME will set the omz theme in the VM. Please try your favorite one</p>\n<p><a href=\"https://github.com/ohmyzsh/ohmyzsh/wiki/Themes\">https://github.com/ohmyzsh/ohmyzsh/wiki/Themes</a></p>\n<h3 id=\"setting-vm-hosts-entries\" style=\"position:relative;\"><a href=\"#setting-vm-hosts-entries\" aria-label=\"setting vm hosts entries permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Setting VM hosts entries</h3>\n<p>If you want to add some hosts entry from the host <code class=\"language-text\">.env</code> file, use <code class=\"language-text\">__VMHOSTS__</code> prefix</p>\n<div class=\"gatsby-highlight\" data-language=\"text\"><pre class=\"language-text\"><code class=\"language-text\">__VMHOSTS__127_0_0_1=somehost</code></pre></div>\n<p>Note that underscores (<code class=\"language-text\">_</code>) will be replaced to <code class=\"language-text\">.</code>.</p>\n<p>Will addd</p>\n<div class=\"gatsby-highlight\" data-language=\"text\"><pre class=\"language-text\"><code class=\"language-text\">127.0.0.1 somehost</code></pre></div>\n<p>to <code class=\"language-text\">/etc/hosts</code> in the VM</p>\n<p>If you need multiple enrties with the same IP address, you will need some suffix to distinguish enrties</p>\n<div class=\"gatsby-highlight\" data-language=\"text\"><pre class=\"language-text\"><code class=\"language-text\">__VMHOSTS__127_0_0_1=somehost\n__VMHOSTS__127_0_0_1_a=anotherhost\n__VMHOSTS__127_0_0_1_t=theotherhost</code></pre></div>\n<p>Anything after 4th underscore is ignored</p>\n<h3 id=\"fonts\" style=\"position:relative;\"><a href=\"#fonts\" aria-label=\"fonts permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Fonts</h3>\n<div class=\"gatsby-highlight\" data-language=\"text\"><pre class=\"language-text\"><code class=\"language-text\">FONT_URLS=https://www.fontsquirrel.com/fonts/download/camingocode\nPATCHED_FONT_URLS=https://github.com/tonsky/FiraCode/releases/download/5.2/Fira_Code_v5.2.zip</code></pre></div>\n<p>will download url and install those automatically.</p>\n<p>you can use urls for ttfs or zip files separated with comma</p>\n<p>It patches font for powerline with <a href=\"https://www.nerdfonts.com/\">nerd fonts</a>.</p>\n<p>For already patched fonts, it can be used in <code class=\"language-text\">PATCHED_FONT_URLS</code></p>","fields":{"slug":"/docs/configuring-vm/","language":""},"frontmatter":{"title":"Configuring VM","date":"October 15, 2021","description":null}},"previous":{"fields":{"slug":"/ko/docs/tips/"},"frontmatter":{"title":"Tips"}},"next":{"fields":{"slug":"/docs/trouble-shooting-and-advanced-usages/"},"frontmatter":{"title":"Trouble shooting and advanced usages"}}},"pageContext":{"id":"bdeda9f4-e066-5cbb-8d3e-d5bc814c0e13","previousPostId":"16173aa3-0137-5eaa-93c4-254d42a584b3","nextPostId":"3983e6bf-1b00-5cf5-ae9e-62d291660e87","language":"en","i18n":{"language":"en","languages":["en","ko","ja"],"defaultLanguage":"en","generateDefaultLanguagePage":false,"routed":false,"originalPath":"/docs/configuring-vm/","path":"/docs/configuring-vm/"}}},
    "staticQueryHashes": ["2355076697","3347749741"]}