{"id":26045110,"url":"https://github.com/tuni56/virtualmachine","last_synced_at":"2026-04-18T14:02:30.692Z","repository":{"id":280963073,"uuid":"943755112","full_name":"tuni56/virtualmachine","owner":"tuni56","description":"Como usar maquinas virtuales con ubuntu, vagrant, python y postgres en windows 11","archived":false,"fork":false,"pushed_at":"2025-03-06T09:38:50.000Z","size":116,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-28T02:13:29.656Z","etag":null,"topics":["postgresql","python-environment","ubuntu","vagrant","virtual-machine"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tuni56.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-03-06T08:04:50.000Z","updated_at":"2025-03-06T09:38:56.000Z","dependencies_parsed_at":null,"dependency_job_id":"cc96f370-05b0-46dd-b78a-a7245e9b7091","html_url":"https://github.com/tuni56/virtualmachine","commit_stats":null,"previous_names":["tuni56/virtualmachine"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tuni56/virtualmachine","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tuni56%2Fvirtualmachine","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tuni56%2Fvirtualmachine/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tuni56%2Fvirtualmachine/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tuni56%2Fvirtualmachine/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tuni56","download_url":"https://codeload.github.com/tuni56/virtualmachine/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tuni56%2Fvirtualmachine/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31971490,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T00:39:45.007Z","status":"online","status_checked_at":"2026-04-18T02:00:07.018Z","response_time":103,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["postgresql","python-environment","ubuntu","vagrant","virtual-machine"],"created_at":"2025-03-07T19:31:41.471Z","updated_at":"2026-04-18T14:02:25.681Z","avatar_url":"https://github.com/tuni56.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Guía Detallada: Ubuntu en VM, Python Virtual Env y PostgreSQL en Windows 11\n\nSi necesitas trabajar con Ubuntu, gestionar entornos virtuales de Python y usar PostgreSQL en Windows 11, esta guía te ayudará a configurarlo paso a paso.\n\n## 1️⃣ Crear una Máquina Virtual Ubuntu con VirtualBox y Vagrant\n\n### 🛠 Requisitos Previos:\n- [Descargar e instalar VirtualBox](https://www.virtualbox.org/)\n- [Descargar e instalar Vagrant](https://developer.hashicorp.com/vagrant/downloads)\n\n### 🚀 Pasos de Instalación:\n1. **Crear una carpeta para el proyecto:**\n   ```sh\n   mkdir ubuntu-vm \u0026\u0026 cd ubuntu-vm\n   ```\n2. **Inicializar un archivo Vagrantfile:**\n   ```sh\n   vagrant init ubuntu/focal64\n   ```\n3. **Editar el `Vagrantfile`** para configurar la VM:\n   ```ruby\n   Vagrant.configure(\"2\") do |config|\n     config.vm.box = \"ubuntu/focal64\"\n     config.vm.network \"private_network\", type: \"dhcp\"\n     config.vm.provider \"virtualbox\" do |vb|\n       vb.memory = \"2048\"\n       vb.cpus = 2\n     end\n   end\n   ```\n4. **Levantar la VM:**\n   ```sh\n   vagrant up\n   ```\n5. **Acceder a la VM:**\n   ```sh\n   vagrant ssh\n   ```\n\n## 2️⃣ Configurar Python con pyenv y virtualenv\n\n### 🛠 Requisitos Previos:\n- Tener la VM Ubuntu en funcionamiento\n- Tener `git`, `curl` y `build-essential` instalados:\n  ```sh\n  sudo apt update \u0026\u0026 sudo apt install -y git curl build-essential\n  ```\n\n### 🚀 Instalación de pyenv y virtualenv:\n1. **Instalar pyenv:**\n   ```sh\n   curl https://pyenv.run | bash\n   ```\n   Agregar estas líneas al final de `~/.bashrc`:\n   ```sh\n   export PATH=\"$HOME/.pyenv/bin:$PATH\"\n   eval \"$(pyenv init --path)\"\n   eval \"$(pyenv virtualenv-init -)\"\n   ```\n   Luego, recargar la configuración:\n   ```sh\n   source ~/.bashrc\n   ```\n2. **Instalar una versión de Python y configurarla:**\n   ```sh\n   pyenv install 3.10.6\n   pyenv global 3.10.6\n   ```\n3. **Crear un entorno virtual:**\n   ```sh\n   pyenv virtualenv 3.10.6 myenv\n   pyenv activate myenv\n   ```\n\n## 3️⃣ Instalar PostgreSQL en WSL y Conectarlo con Windows\n\n### 🛠 Requisitos Previos:\n- Tener habilitado el **Subsistema de Windows para Linux (WSL2)**\n- Instalar Ubuntu desde la Microsoft Store\n\n### 🚀 Instalación de PostgreSQL en WSL:\n1. **Abrir Ubuntu en Windows y actualizar paquetes:**\n   ```sh\n   sudo apt update \u0026\u0026 sudo apt upgrade -y\n   ```\n2. **Instalar PostgreSQL:**\n   ```sh\n   sudo apt install -y postgresql postgresql-contrib\n   ```\n3. **Iniciar el servicio PostgreSQL:**\n   ```sh\n   sudo service postgresql start\n   ```\n4. **Acceder a la base de datos como usuario `postgres`:**\n   ```sh\n   sudo -i -u postgres\n   psql\n   ```\n   Para salir de PostgreSQL, escribe `\\q`.\n\n### 🎯 Conectar PostgreSQL desde Windows:\n1. **Obtener la IP de WSL:**\n   ```sh\n   ip addr show eth0 | grep \"inet \" | awk '{print $2}' | cut -d'/' -f1\n   ```\n2. **Permitir conexiones remotas en PostgreSQL:**\n   ```sh\n   sudo nano /etc/postgresql/14/main/postgresql.conf\n   ```\n   Cambiar esta línea:\n   ```sh\n   listen_addresses = '*'\n   ```\n3. **Configurar acceso desde Windows:**\n   ```sh\n   sudo nano /etc/postgresql/14/main/pg_hba.conf\n   ```\n   Agregar al final:\n   ```sh\n   host    all             all             0.0.0.0/0               md5\n   ```\n4. **Reiniciar PostgreSQL:**\n   ```sh\n   sudo service postgresql restart\n   ```\n5. **Conectar desde Windows con un cliente PostgreSQL (pgAdmin, DBeaver, etc.)** usando la IP de WSL y el puerto `5432`.\n\n---\n\n🎉 **¡Listo! Ahora tienes un entorno de desarrollo completo con Ubuntu, Python y PostgreSQL en Windows 11.** Si esta guía te ayudó, ¡compártela con otros! 🚀\n    ** No olvides darle una estrellita al repositorio!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftuni56%2Fvirtualmachine","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftuni56%2Fvirtualmachine","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftuni56%2Fvirtualmachine/lists"}