Git Product home page Git Product logo

machine-to-proxmox-lxc-ct-converter's Introduction

GNU/Linux Machine to Proxmox LXC Container Converter

GitHub contributors GitHub stars

This script simplifies the process of converting a Machine/VM linux into a Proxmox LXC container. Follow the prompts to provide essential details, and the script will handle the conversion seamlessly.

Prerequisites

  • This script must be run on the Proxmox host machine.
  • Ensure that the 'pct' command is available on your Proxmox host machine.

Installation

  1. Clone this repository on the Proxmox host machine and give execution permissions to the scripts:

    git clone https://github.com/mathewalves/machine-to-proxmox-lxc-ct-converter.git
    cd machine-to-proxmox-lxc-ct-converter
    chmod +x convert.sh bashconvert
  2. Run the script as a root:

    ./convert.sh

Usage

  1. Run the script and follow the interactive prompts to provide necessary details for the conversion.

  2. The script will initiate the conversion process. Note that you need the SSH key of the machine and the SSH port.

  3. Once the conversion is complete, the Proxmox LXC container will be created.

Options & Alternatives

If desired, use ./bashconvert to perform the conversion process using Bash.

./bashconvert -h |--help
 -n|--name [lxc container name]
 -t|--target [target machine ssh uri]
 -P|--port [target port ssh]
 -i|--id [proxmox container id]
 -s|--root-size [rootfs size in GB]
 -a|--ip [target container ip]
 -b|--bridge [bridge interface]
 -g|--gateway [gateway ip]
 -m|--memory [memory in mb]
 -d|--disk-storage [target proxmox storage pool]
 -p|--password [root password for container (min. 5 chars)]

Customize as needed based on your specific requirements.

Troubleshooting

  • If 'pct' or 'sshpass' is not available, the script will attempt to install 'sshpass' in the background.

machine-to-proxmox-lxc-ct-converter's People

Contributors

blauskaerm avatar mathewalves avatar my5t3ry avatar zartek-creole avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

machine-to-proxmox-lxc-ct-converter's Issues

./convert.sh: line 63: pct: command not found on non-proxmox machine

Trying to convert a LCX container from a non-proxmox machine to a proxmox machine, but getting:

./convert.sh: line 63: pct: command not found

Apparently it can't run this part:

pct create $id "/tmp/$name.tar.gz" \
  -description LXC \
  -hostname $name \
  --features nesting=1 \
  -memory $memory -nameserver 8.8.8.8 \
  -net0 name=eth0,ip=$ip/24,gw=$gateway,bridge=$bridge \
  --rootfs $rootsize -storage $storage -password $password

Is this supposed to happen?

No console after move to LXC

I have moved opensuse to LXC. Looks all okay, except I have no console in Proxmox for this container.

I see that it is expected be tty1(when I an sending to tty1 i see output) but no login prompts.

Any idea? Apparmor already off.

PVE 8.0.4 error

Enter new password: **************
Retype new password: **************
400 Parameter verification failed.
rootfs: invalid format - format error
rootfs.volume: property is missing and it is not optional

memory: type check ('integer') failed - got ''
vmid: type check ('integer') failed - got ''
net0: invalid format - missing key in comma-separated list property

storage: invalid format - storage ID '' contains illegal characters

pct create [OPTIONS]
-bash: -i: command not found

command run:

./convert.sh
-n NewTestCTConvert
-t 192.168.1.119
-P 22 \
-i 109
-s 130
-a 192.168.1.121
-b vmbr0
-g 192.168.1.1
-m 2048
-d default
-p Somepassword

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.