Skip to content

zyobum/myshell

Repository files navigation

A ubuntu shell for macOS

  1. Setup mac terminal. read more here

  2. Clone the repository

    git clone git@github.com:zyobum/shell.git ~/workspace/myshell
  3. Install 'lima' and required packages.

    brew install lima jq
  4. Start new instance with pre-definedlib example:docker

    limactl start --name=default template://docker
  5. Stop the docker instance

    limactl factory-reset default
  6. Modify mount points. Put following lines in the mount section of ~/.lima/default/lima.yaml

    1. Remove "~" home folder

    2. Add following mount point

      - location: "~/.ssh/myshell_keys"
        writable: true
      - location: "~/workspace"
        writable: true
      - location: "~/Downloads"
        writable: true
  7. Append the following lines after the mount section:

    ssh:
      forwardAgent: true
      forwardX11Trusted: true
  8. Append new script in the provision section:

    - mode: user
      script: |
        #!/bin/bash
        curl -sfL https://github.com/zyobum/shell/raw/main/myconfig.sh | bash -s - > /tmp/lima/myconfig.out 2>&1
  9. Append the following line in the message section:

    Restart the instance to finish the provisioning by 'limactl stop default && limactl start default'
    Install Quartz for X11 support.
    
  10. start instance

    limactl start default
  11. Check instance status

    limactl list
  12. Check the progress of provision

    tail -f /tmp/myshell_service.err
  13. Check the progress of myconfig.sh

    tail -f /tmp/lima/myconfig.out
  14. If lima instance status became 'borken'

    limactl stop -f default
  15. Install fonts for Terminal. Follow the instruction here: https://github.com/romkatv/powerlevel10k#manual-font-installation

  16. Test myshell

    limactl start default
    lima
  17. Run the Shell - In the preference page of the terminal, choose the desired profile - In the 'Startup' section of the 'Shell' tab, check 'Run command' and set the following command:

    /bin/bash -c "$HOME/workspace/myshell/myshell.sh"
  18. Install login autostart. copy 'Startup.sh' to home directory and assign it as a login item in the setting pane. https://stackoverflow.com/questions/6442364/running-script-upon-login-in-mac-os-x

  • Note: Do not use sudo reboot in the box, the mount points will lost. Use limactl stop and limactl start instead.
  • known issue: shutdown or poweroff cause the vm to 'Borken' state.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages