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

Feature request: change "home" directory location, and/or support XDG Base Directory spec #483

Closed
gwerbin opened this issue Nov 17, 2022 · 12 comments
Labels
enhancement New feature or request
Milestone

Comments

@gwerbin
Copy link

gwerbin commented Nov 17, 2022

Description

It would be really nice if we could change the location of the Colima "home" directory to something other than ~/.colima.

For example, I tend to create directories in ~/.local/opt for tools like this, so it would be nice if I could set export COLIMA_HOME=$HOME/.local/opt/colima in my system configuration.

Alternatively, it would be nice if Colima supported the XDG Base Directory Specification. The config files would be located in XDG_CONFIG_HOME, the daemon socket could be located in XDG_STATE_HOME, etc.

I think many people nowadays like to keep as few "dotfiles" in their home directory as possible, and this would be a nice quality of life addition for those users.

@gwerbin gwerbin changed the title Change "home" directory location and/or support XDG Base Directory spec Feature request: change "home" directory location, and/or support XDG Base Directory spec Nov 17, 2022
@abiosoft abiosoft added the enhancement New feature or request label Nov 18, 2022
@abiosoft
Copy link
Owner

I am onboard with this.

@kamalsacranie
Copy link

2nd this feature! it would be a lovely addition if at all possible!

@watersb
Copy link
Contributor

watersb commented May 26, 2023

Here's a patch, briefly tested on macOS 13.4

It defers to using $XDG_CONFIG_HOME/colima, then os.UserConfigDir().

We may wish to additionally consider an environment variable like COLIMA_HOME, which corresponds to LIMA_HOME in the Lima tool...

colima-XDGBaseDir.patch

@OJFord
Copy link

OJFord commented Apr 11, 2024

I installed and started colima, and it created ~/.colima

I ran colima stop && mv ~/.colima ~/.config/colima

Then colima start recreated and used ~/.colima (I noticed because colima start -edit showed it had lost the changes I made to colima template before the mv).

What am I doing wrong?

colima version 0.6.8

@Rahlir
Copy link

Rahlir commented May 10, 2024

I installed and started colima, and it created ~/.colima

I ran colima stop && mv ~/.colima ~/.config/colima

Then colima start recreated and used ~/.colima (I noticed because colima start -edit showed it had lost the changes I made to colima template before the mv).

What am I doing wrong?

colima version 0.6.8

I have a same problem on macOS Sonoma...

@Rahlir
Copy link

Rahlir commented May 10, 2024

I installed and started colima, and it created ~/.colima
I ran colima stop && mv ~/.colima ~/.config/colima
Then colima start recreated and used ~/.colima (I noticed because colima start -edit showed it had lost the changes I made to colima template before the mv).
What am I doing wrong?

colima version 0.6.8

I have a same problem on macOS Sonoma...

I guess it has something to do with this, but I have no idea why there is this exception in the code...

@OJFord
Copy link

OJFord commented May 12, 2024

Ah, nice find, I was also using macOS.

Can that be removed @abiosoft?

@abiosoft
Copy link
Owner

abiosoft commented Jul 29, 2024

It is being removed and would be part of the next release.

@dimitarvp
Copy link

I have noticed the comment by @abiosoft is from 29th of July and 0.7.0 release is dated 30th of July so I am not sure if my problem is scheduled for a fix, or it is deemed fixed but it's actually not.

With colima 0.7.0 and after doing mv ~/.colima ~/.config/colima (I was prompted to do that by colima) then colima start fails:

INFO[0000] starting colima
INFO[0000] runtime: docker
INFO[0000] starting ...                                  context=vm
> "[hostagent] failed to exit SSH master" error="failed to execute `ssh -O exit -p 55533 127.0.0.1`, out=\"Control socket connect(/Users/dimi/.config/colima/_lima/colima/ssh.sock): No such file or directory\\r\\n\": exit status 255"
> [hostagent] Shutting down QEMU with ACPI
> [hostagent] Failed to remove SSH binding for port 55533
> "[hostagent] failed to open the QMP socket \"/Users/dimi/.config/colima/_lima/colima/qmp.sock\", forcibly killing QEMU" error="dial unix /Users/dimi/.config/colima/_lima/colima/qmp.sock: connect: connection refused"
> [hostagent] QEMU has already exited
> exiting, status={Running:false Degraded:false Exiting:true Errors:[] SSHLocalPort:0} (hint: see "/Users/dimi/.config/colima/_lima/colima/ha.stderr.log")
FATA[0001] error starting vm: error at 'starting': exit status 1

Doing the opposite move -- mv ~/.config/colima ~/.colima -- makes colima work again.

Is this scheduled for a fix or it got under the radar? I am on macOS Sonoma 14.6.

@abiosoft
Copy link
Owner

abiosoft commented Aug 8, 2024

@dimitarvp that should not happen. I would do a bit more testing on my end to see if I can reproduce your experience.

@dimitarvp
Copy link

Disclosure: I made zero effort in fixing anything at all, I only issued the mv command and attempted colima start. If there's anything else needed, like maybe rm-ing or touch-ing files / dirs, let me know.

@abiosoft
Copy link
Owner

abiosoft commented Aug 8, 2024

Disclosure: I made zero effort in fixing anything at all, I only issued the mv command and attempted colima start. If there's anything else needed, like maybe rm-ing or touch-ing files / dirs, let me know.

Yeah, there should indeed be zero efforts. It should just work.

Thanks for the info.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

7 participants