{"id":9214,"date":"2020-02-07T13:30:31","date_gmt":"2020-02-07T12:30:31","guid":{"rendered":"https:\/\/blog.unelink.es\/?p=9214"},"modified":"2020-02-07T13:30:34","modified_gmt":"2020-02-07T12:30:34","slug":"poder-usar-nfs-en-contenedores-lxc","status":"publish","type":"post","link":"https:\/\/hosting.airetech.es\/blog\/wiki\/poder-usar-nfs-en-contenedores-lxc\/","title":{"rendered":"Poder usar NFS en contenedores LXC"},"content":{"rendered":"\n<p>Para que <strong>funcione el servicio NFS en un contenedor LXC tenemos que agregarle una opci\u00f3n a la configuraci\u00f3n LXC del contenedor<\/strong>. Vamos a ver c\u00f3mo hacerlo.<\/p>\n\n\n\n<p>Lo primero que tienes que hacer para esto es <strong>apagar el servidor<\/strong>.<\/p>\n\n\n\n<p>Una vez apagado, entra por <strong>SSH al servidor que tiene el contenedor<\/strong> para modificar su archivo de configuraci\u00f3n.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"583\" height=\"470\" src=\"https:\/\/hosting.airetech.es\/blog\/wp-content\/uploads\/2020\/02\/ssh.jpg\" alt=\"\" class=\"wp-image-9215\" srcset=\"https:\/\/hosting.airetech.es\/blog\/wp-content\/uploads\/2020\/02\/ssh.jpg 583w, https:\/\/hosting.airetech.es\/blog\/wp-content\/uploads\/2020\/02\/ssh-300x242.jpg 300w\" sizes=\"auto, (max-width: 583px) 100vw, 583px\" \/><\/figure><\/div>\n\n\n\n<p>En <strong>Proxmox<\/strong>, por ejemplo, los archivos de <strong>configuraci\u00f3n de cada contenedor LXC se encuentran en<\/strong> la ruta:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">\/etc\/pve\/lxc<\/pre>\n\n\n\n<p>Vamos a tomar como ejemplo un contenedor con el identificador 100. Para modificar su archivo de configuraci\u00f3n <strong>utiliza el comando<\/strong>:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">nano \/etc\/pve\/lxc\/100.conf<\/pre>\n\n\n\n<p>El archivo de configuraci\u00f3n tendr\u00e1 un contenido similar a este:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">arch: amd64<br \/>cores: 8<br \/>features: mount=nfs<br \/>hostname: test.server.local<br \/>memory: 7168<br \/>nameserver: 8.8.8.8<br \/>net0: name=eth0,bridge=vmbr0,firewall=1,gw=X.X.X.X,hwaddr=A2:15:92:50:F2:39,ip=X.X.X.X\/32,type=veth<br \/>onboot: 1<br \/>ostype: ubuntu<br \/>rootfs: local-lvm:vm-100-disk-0,size=3500G<br \/>searchdomain: unelink.net<br \/>swap: 1024<\/pre>\n\n\n\n<p>Ahora tienes que <strong>a\u00f1adir al final del fichero la l\u00ednea<\/strong> que permitir\u00e1 el uso de NFS.<\/p>\n\n\n\n<p>Para <strong>versiones de LXC inferiores a la 3<\/strong> la l\u00ednea a a\u00f1adir ser\u00eda:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">lxc.aa_profile: unconfined<\/pre>\n\n\n\n<p>Para la <strong>versi\u00f3n 3 de LXC o superiores<\/strong>, la l\u00ednea ser\u00eda:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">lxc.apparmor.profile: unconfined<\/pre>\n\n\n\n<p><strong>Guardamos el fichero de configuraci\u00f3n<\/strong> y posteriormente arrancamos el contenedor. <\/p>\n\n\n\n<p>Una vez hecho esto <strong>ya podemos realizar la instalaci\u00f3n normal de NFS<\/strong>.<\/p>\n\n\n\n<p>Esperamos que esta entrada te sea de utilidad.<\/p>\n","protected":false},"excerpt":{"rendered":"Para que funcione el servicio NFS en un contenedor LXC tenemos que agregarle una opci\u00f3n a la configuraci\u00f3n LXC del contenedor. Vamos a ver c\u00f3mo hacerlo. Lo primero que tienes que hacer para esto es apagar el servidor. Una vez apagado, entra por SSH al servidor que tiene el contenedor para modificar su archivo de configuraci\u00f3n. En Proxmox, por ejemplo,&nbsp;<a href=\"https:\/\/hosting.airetech.es\/blog\/wiki\/poder-usar-nfs-en-contenedores-lxc\/\" class=\"read-more\">Seguir leyendo<\/a>","protected":false},"author":1,"featured_media":9215,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[10,510,7,11,6],"tags":[567,566,570,568,569],"class_list":["post-9214","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux","category-proxmox","category-servidores-dedicados","category-virtualizacion","category-wiki","tag-contenedores-lxc","tag-lxc","tag-poder-usar-nfs","tag-usar-nfs","tag-usar-nfs-en-lxc","cat-10-id","cat-510-id","cat-7-id","cat-11-id","cat-6-id"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/hosting.airetech.es\/blog\/wp-json\/wp\/v2\/posts\/9214","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hosting.airetech.es\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hosting.airetech.es\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hosting.airetech.es\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/hosting.airetech.es\/blog\/wp-json\/wp\/v2\/comments?post=9214"}],"version-history":[{"count":1,"href":"https:\/\/hosting.airetech.es\/blog\/wp-json\/wp\/v2\/posts\/9214\/revisions"}],"predecessor-version":[{"id":9216,"href":"https:\/\/hosting.airetech.es\/blog\/wp-json\/wp\/v2\/posts\/9214\/revisions\/9216"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/hosting.airetech.es\/blog\/wp-json\/wp\/v2\/media\/9215"}],"wp:attachment":[{"href":"https:\/\/hosting.airetech.es\/blog\/wp-json\/wp\/v2\/media?parent=9214"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hosting.airetech.es\/blog\/wp-json\/wp\/v2\/categories?post=9214"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hosting.airetech.es\/blog\/wp-json\/wp\/v2\/tags?post=9214"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}