getumbrel / umbrel-apps

The official app repository of the Umbrel App Store. Submit apps and updates here. Learn how → https://github.com/getumbrel/umbrel-apps#readme
https://apps.umbrel.com
481 stars 356 forks source link

How to run Multipass umbrel-dev in Windows? #1088

Closed Impa10r closed 3 weeks ago

Impa10r commented 1 month ago

I want to create a test VM in Windows 10. I installed Multipass and nodejs, cloned umbrel repo and get this:

PS E:\umbrel> npm run vm:provision

> vm:provision
> multipass launch --name umbrel-dev --cpus 4 --memory 8G --disk 50G --mount $PWD:/opt/umbrel-mount 23.10 && multipass exec umbrel-dev -- /opt/umbrel-mount/scripts/vm provision

Mount source path "$PWD" does not exist

If I manually launch with $(pwd) I get this:

PS E:\umbrel> multipass launch --name umbrel-dev --cpus 4 --memory 8G --disk 150G --mount $(pwd):/opt/umbrel-mount 23.10             
Too many arguments supplied

Removing 23.10 I get this:

PS E:\umbrel> multipass launch --name umbrel-dev --cpus 4 --memory 8G --disk 150G --mount $(pwd):/opt/umbrel-mount
launch failed: '/opt/umbrel-mount' is not a supported alias. Please use `multipass find` for supported image aliases.
PS E:\umbrel> multipass find
Image                       Aliases           Version          Description
core                        core16            20200818         Ubuntu Core 16
core18                                        20211124         Ubuntu Core 18
core20                                        20230119         Ubuntu Core 20
core22                                        20230717         Ubuntu Core 22
20.04                       focal             20240430         Ubuntu 20.04 LTS
22.04                       jammy             20240426         Ubuntu 22.04 LTS
23.10                       mantic            20240508         Ubuntu 23.10
24.04                       noble,lts         20240423         Ubuntu 24.04 LTS
appliance:adguard-home                        20200812         Ubuntu AdGuard Home Appliance
appliance:mosquitto                           20200812         Ubuntu Mosquitto Appliance
appliance:nextcloud                           20200812         Ubuntu Nextcloud Appliance
appliance:openhab                             20200812         Ubuntu openHAB Home Appliance
appliance:plexmediaserver                     20200812         Ubuntu Plex Media Server Appliance

Blueprint                   Aliases           Version          Description
anbox-cloud-appliance                         latest           Anbox Cloud Appliance
charm-dev                                     latest           A development and testing environment for charmers
docker                                        0.4              A Docker environment with Portainer and related tools
jellyfin                                      latest           Jellyfin is a Free Software Media System that puts you in control of managing and streaming your media.
minikube                                      latest           minikube is local Kubernetes
ros-noetic                                    0.1              A development and testing environment for ROS Noetic.
ros2-humble                                   0.1              A development and testing environment for ROS 2 Humble.

If I already have Umbrel 1.1.2 installed in Debian VM, can I use some other way to install a custom app repo? There is no scripts folder...

Impa10r commented 1 month ago

works for me with explicit mount location:

PS E:\umbrel> multipass launch --name umbrel-dev --cpus 4 --memory 8G --disk 150G --mount E:\umbrel:/opt/umbrel-mount 23.10
Launched: umbrel-dev
Mounted 'E:\umbrel' into 'umbrel-dev:/opt/umbrel-mount'
PS E:\umbrel>  multipass list
Name                    State             IPv4             Image
primary                 Stopped           --               Ubuntu 24.04 LTS
umbrel-dev              Running           172.27.223.137   Ubuntu 23.10
Impa10r commented 1 month ago

but http://umbrel-dev.local is unreachable and I get this error:

PS E:\umbrel> multipass exec umbrel-dev
Wrong number of arguments
PS E:\umbrel> npm run vm:exec -- sudo journalctl -u umbreld

> vm:exec
> multipass exec --working-directory /home/ubuntu umbrel-dev -- sudo journalctl -u umbreld

-- No entries --
PS E:\umbrel>

in Shell I see this:

ubuntu@umbrel-dev:/opt/umbrel-mount/scripts$ sudo chmod +x vm
ubuntu@umbrel-dev:/opt/umbrel-mount/scripts$ ls -l
total 104
-rw-rw-rw- 1 ubuntu ubuntu 17248 May 14 01:04 app
drwxrwxrwx 1 ubuntu ubuntu     0 May 14 01:04 backup
-rw-rw-rw- 1 ubuntu ubuntu  8959 May 14 01:04 configure
-rw-rw-rw- 1 ubuntu ubuntu 10661 May 14 01:04 data-export
-rw-rw-rw- 1 ubuntu ubuntu  6006 May 14 01:04 debug
-rw-rw-rw- 1 ubuntu ubuntu  1074 May 14 01:04 install
-rw-rw-rw- 1 ubuntu ubuntu   810 May 14 01:04 memory-monitor
-rw-rw-rw- 1 ubuntu ubuntu  1714 May 14 01:04 memory-usage
-rw-rw-rw- 1 ubuntu ubuntu 11072 May 14 01:04 repo
-rw-rw-rw- 1 ubuntu ubuntu  1621 May 14 01:04 rpcauth.py
-rw-rw-rw- 1 ubuntu ubuntu  6229 May 14 01:04 start
drwxrwxrwx 1 ubuntu ubuntu     0 May 14 01:04 status
-rw-rw-rw- 1 ubuntu ubuntu   495 May 14 01:04 status-monitor
-rw-rw-rw- 1 ubuntu ubuntu  1819 May 14 01:04 stop
drwxrwxrwx 1 ubuntu ubuntu     0 May 14 01:04 support
drwxrwxrwx 1 ubuntu ubuntu     0 May 14 01:04 umbrel-os
drwxrwxrwx 1 ubuntu ubuntu     0 May 14 01:04 update
-rw-rw-rw- 1 ubuntu ubuntu   710 May 14 01:04 update-script
-rw-rw-rw- 1 ubuntu ubuntu  3429 May 14 01:04 vm
ubuntu@umbrel-dev:/opt/umbrel-mount/scripts$ sudo ./vm provision
sudo: ./vm: command not found
Impa10r commented 1 month ago
ubuntu@umbrel-dev:/opt/umbrel-mount/scripts$ sudo cp vm /usr/local/bin/
ubuntu@umbrel-dev:/opt/umbrel-mount/scripts$ cd /usr/local/bin/
ubuntu@umbrel-dev:/usr/local/bin$ ls
vm
ubuntu@umbrel-dev:/usr/local/bin$ sudo chmod +x vm
ubuntu@umbrel-dev:/usr/local/bin$ ls -l
total 4
-rwxr-xr-x 1 root root 3429 May 14 10:46 vm
ubuntu@umbrel-dev:/usr/local/bin$ sudo ./vm provision
/usr/bin/env: ‘bash\r’: No such file or directory
/usr/bin/env: use -[v]S to pass options in shebang lines
ubuntu@umbrel-dev:/usr/local/bin$ which bash
/usr/bin/bash
ubuntu@umbrel-dev:/usr/local/bin$ nano vm
ubuntu@umbrel-dev:/usr/local/bin$ sudo nano vm
ubuntu@umbrel-dev:/usr/local/bin$ sudo ./vm provision
sudo: unable to execute ./vm: Permission denied
ubuntu@umbrel-dev:/usr/local/bin$ ls -l
total 4
-rwxr-xr-x 1 root root 3427 May 14 10:49 vm
yhunko commented 1 month ago

I can confirm. http://umbrel-dev.local is not starting. Didn't find any configuration issues so far ((

BTW: The provision command is fixed with the ${PWD} curly braces.

PS D:\Dev\GitHub\umbrel> multipass launch --name umbrel-dev --cpus 4 --memory 8G --disk 50G --mount ${PWD}:/opt/umbrel-mount 23.10 && multipass exec umbrel-dev -- /opt/umbrel-mount/scripts/vm provision
Impa10r commented 1 month ago

Ended up using this alternative: https://github.com/highghlow/umbrel-install-script

sharknoon commented 1 month ago

I am using this:

# Feel free to bump the specs
multipass launch --name umbrel-dev --cpus 4 --memory 8G --disk 50G 23.10
# Fake the mount directory by creating it manually
multipass exec umbrel-dev -- sudo mkdir /opt/umbrel-mount
multipass exec umbrel-dev -- sudo chown ubuntu:ubuntu /opt/umbrel-mount
# Cloning instead of mounting ensures the correct +x flags are set and the line breaks (\n instead of \r\n) are correct
multipass exec umbrel-dev -- git clone https://github.com/getumbrel/umbrel.git /opt/umbrel-mount
multipass exec umbrel-dev -- /opt/umbrel-mount/scripts/vm provision
nmfretz commented 3 weeks ago

Thanks for this solution @sharknoon!

@Impa10r, with sharknoon's solution I am closing this issue. Please feel free to reopen if you still have issues.

sharknoon commented 3 weeks ago

You are very welcome 😀