Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to start VM after closing command prompt on Windows #977

Open
jasmaa opened this issue Jun 12, 2024 · 0 comments
Open

Unable to start VM after closing command prompt on Windows #977

jasmaa opened this issue Jun 12, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@jasmaa
Copy link

jasmaa commented Jun 12, 2024

Describe the bug

On Windows, if the command prompt window used to start the Finch VM is closed without manually stopping the VM, Finch VM fails to restart with error saying it cannot attach disk.

The only workaround for this seems to be to remove and re-initialize the VM every time this happens.

Steps to reproduce

Open command prompt and initialize Finch VM:

finch vm init

Close and reopen command prompt. Start VM:

finch vm start

Expected behavior

Finch VM should attach disk and successfully start.

Screenshots or logs

Finch VM runs after init:

C:\Users\Jason>finch vm init
time="2024-06-12T06:47:30-04:00" level=info msg="attaching disk at path: C:\\Users\\Jason\\AppData\\Local\\.finch\\.disks\\6b456cb759bdbc3f.vhdx"
time="2024-06-12T06:47:32-04:00" level=info msg="Initializing and starting Finch virtual machine..."
time="2024-06-12T06:48:11-04:00" level=info msg="Finch virtual machine started successfully"

C:\Users\Jason>finch image ls
REPOSITORY                          TAG       IMAGE ID        CREATED           PLATFORM       SIZE       BLOB SIZE
public.ecr.aws/finch/hello-finch    latest    a71e474da9ff    24 minutes ago    linux/amd64    1.7 MiB    1.0 MiB

Finch VM fails to start after exiting and re-opening in CMD:

C:\Users\Jason>finch image ls
time="2024-06-12T06:51:15-04:00" level=fatal msg="instance \"finch\" is stopped, run `finch vm start` to start the instance"

C:\Users\Jason>finch vm start
time="2024-06-12T06:51:33-04:00" level=info msg="attaching disk at path: C:\\Users\\Jason\\AppData\\Local\\.finch\\.disks\\6b456cb759bdbc3f.vhdx"
time="2024-06-12T06:51:33-04:00" level=fatal msg="could not attach persistent disk: failed to attach disk: exit status 0xffffffff, command output: Failed to attach disk '\\\\?\\C:\\Users\\Jason\\AppData\\Local\\.finch\\.disks\\6b456cb759bdbc3f.vhdx' to WSL2: Error: 0x80040312\r\nError code: Wsl/Service/AttachDisk/MountVhd/WSL_E_USER_VHD_ALREADY_ATTACHED\r\n"

Additional context

Support bundle:
finch-support-20240612065332.zip

Finch version:

C:\Users\Jason>finch -v
finch version v1.1.3

WSL version:

C:\Users\Jason>wsl -v
WSL version: 2.1.5.0
Kernel version: 5.15.146.1-2
WSLg version: 1.0.60
MSRDC version: 1.2.5105
Direct3D version: 1.611.1-81528511
DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Windows version: 10.0.22621.3593
@jasmaa jasmaa added the bug Something isn't working label Jun 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant