Skip to content

Instantly share code, notes, and snippets.

@Cdaprod
Last active March 28, 2024 21:32
Show Gist options
  • Save Cdaprod/db5cc2c074ef9f1a89c863037f117583 to your computer and use it in GitHub Desktop.
Save Cdaprod/db5cc2c074ef9f1a89c863037f117583 to your computer and use it in GitHub Desktop.

Setting up an Ubuntu server to function as a LinuxCNC server

...with auto-boot and network configuration involves several steps. Below, I'll guide you through the key steps to achieve this. Keep in mind that depending on your specific version of Ubuntu and hardware, some steps might require slight adjustments.

  1. Initial SetupInstall Ubuntu Server: Start by installing Ubuntu Server on your hardware. You can download it from the official Ubuntu website. Choose the LTS version for stability.Update System:sudo apt-get update && sudo apt-get upgrade -y
  2. Install LinuxCNCAdd LinuxCNC Repository: Before installing LinuxCNC, add the LinuxCNC repository to your system.sudo add-apt-repository ppa:linuxcnc/ppa sudo apt-get update Install LinuxCNC:sudo apt-get install linuxcnc-uspace -y
  3. Auto Boot ConfigurationCreate a Service for LinuxCNC: To make LinuxCNC start automatically at boot, create a systemd service file.sudo nano /etc/systemd/system/linuxcnc.service Add the following content to the file:[Unit] Description=LinuxCNC Service After=network.target

[Service] Type=simple User=your_username ExecStart=/usr/bin/linuxcnc

[Install] WantedBy=multi-user.target Replace your_username with your actual username.Enable the Service:sudo systemctl enable linuxcnc.service sudo systemctl start linuxcnc 4. Network ConfigurationStatic IP Address (Optional): If you need a static IP address for your LinuxCNC server:Edit the Netplan configuration file (the filename might differ):sudo nano /etc/netplan/50-cloud-init.yaml Configure it with static IP (adjust according to your network):network: version: 2 ethernets: enp0s25: dhcp4: no addresses: - 192.168.1.100/24 gateway4: 192.168.1.1 nameservers: addresses: [8.8.8.8, 8.8.4.4] Apply the changes:sudo netplan apply Verify Network Configuration: Ensure your server is correctly connected to your network and accessible from other machines.5. Testing and ValidationReboot and Validate: Reboot your server to ensure everything (LinuxCNC and network settings) starts up correctly.sudo reboot Access LinuxCNC: After reboot, verify that LinuxCNC is running. You might need to access it directly or via SSH to confirm its status.Network Test: From another machine on the same network, try to ping your LinuxCNC server using its IP address to ensure network connectivity.This guide provides a fundamental setup. Depending on your specific requirements, you might need to adjust firewall settings, configure additional LinuxCNC settings, or optimize your Ubuntu server for performance and security. Always refer to the official documentation for the most detailed and updated information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment