Navigation

    FOG Project

    • Register
    • Login
    • Search
    • Recent
    • Unsolved
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    1. Home
    2. danboid
    D
    • Profile
    • Following
    • Followers
    • Topics
    • Posts
    • Best
    • Groups

    danboid

    @danboid

    1
    Reputation
    9
    Posts
    2
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

    danboid Follow

    Best posts made by danboid

    • Configuring a standalone FOG VM under Ubuntu 20.04

      Configuring a standalone FOG VM under Ubuntu 20.04

      by Dan MacDonald

      FOG (Free Open Ghost) makes it quick and easy to deploy Windows, Linux or macOS images over a wired network using iPXE, partclone, apache and other open source software under the hood. The aim of this guide is to set up a FOG server running in a Ubuntu Server 20.04 VM hosted by qemu running on Ubuntu 20.04. I use virt-manager to simplify the process of creating and managing the VM.

      This server will be running its own DHCP and DNS servers so that all you will need is your FOG VM, a switch and some ethernet cables to image machines. FOG and its required services (like DHCP and DNS servers) are things I don’t usually want to be running on my laptop or workstation which is why it’s useful to have FOG running inside of a VM so you can quickly fire it up as and when it’s needed.

      User groups for virt-manager

      If you want to run virt-manager as a normal user, make sure your user is in both the kvm and libvirt groups. Remember you need to log out and back in after adding your user to a group before it takes effect.

      Create bridge interface on host machine

      When you install virt-manager a virbr0 network bridge is created but this doesn’t work to host a FOG server. Instead we need to create a bridge interface, br0, by editing /etc/netplan/01-network-manager-all.yaml to look like this:

      network:
        version: 2
        renderer: networkd
      
        ethernets:
          enp0s31f6:
            dhcp4: false
            dhcp6: false
      
        bridges:
          br0:
            interfaces: [enp0s31f6]
            addresses: [192.168.0.33/24]
            gateway4: 192.168.0.1
            mtu: 1500
            nameservers:
              addresses: [1.1.1.1]
            parameters:
              stp: true
              forward-delay: 4
            dhcp4: no
            dhcp6: no
      

      Make sure you at least modify enp0s31f6 above to match the wired interface name on your host machine - run ip l to list your network interfaces. You will need to reboot for the new network config to take effect.

      Note that using this netplan config will switch your Ubuntu box from using NetworkManager to using networkd, which is part of systemd. Whilst this will get FOG working, it also has the effect of breaking the network applets used by most Linux desktops because they nearly all use NM behind the scenes.

      It is possible to configure netplan to connect to wifi when using systemd but its not as simple as when using the NM applet. It is also possible to connect to wifi using wpasupplicant and wpa_gui whilst using networkd but I have not tested those with networkd yet. I’ll only be using the above networkd bridge config on my laptop when using FOG and use default Ubuntu NM config the rest of the time for easier wifi access.

      Create a FOG VM

      Download the Ubuntu Server 20.04 install image. Ubuntu 20.04 has the advantage over Debian 10 or RHEL 8 in that its kernel and qemu packages are recent enough to enable you to use Virtio-FS to share the hosts disk with the VM if your host supports NUMA. It is still possible to use Virtio-FS without NUMA but that requires qemu 5.x and Ubuntu 20.04 ships qemu 4.2.

      When creating the FOG VM in virt-manager, I assigned it 4 GB RAM and 4 VCPUs. You could get away with as little as 512 MB RAM, 1 VCPU and a 4 GB disk for your FOG VM and it should still run, if you don’t install any other software and you have the /images directory hosted elsewhere but generally you will want to make the VM disk as large as possible. You can easily use 200 GB imaging a modern Windows 10 box with a few big apps installed. On the last step of creating a new VM in virt-manager, for the Network selection I chose the option “Bridge br0: Host device enp0s31f6”.

      I find it easier to configure a static IP using the Ubuntu server installer so choose the Manual network configuration. For your FOG servers subnet you will likely want to use something like 192.168.0.0/24. I used 192.168.0.44 for the address, 1.1.1.1 for the nameserver and my gateway is 192.168.0.1. If you skipped the manual network config screen of the Ubuntu Server installer, you can alternately edit /etc/netplan/00-installer-config.yaml to look like this:

      network:
        ethernets:
          enp1s0:
            addresses:
            - 192.168.0.44/24
            gateway4: 192.168.0.1
            nameservers:
              addresses:
              - 1.1.1.1
        version: 2
      

      I used the Ubuntu server guided disk defaults, using the whole disk. It’s debatable how much use LVM is when used in VMs, its much easier to resize disks without it but its the default in Ubuntu server.

      On the Ubuntu server Profile Setup page, enter fog-server for the server name. Install the SSH server but don’t install any of the server snaps and cancel the updates at the end, we’ll update after booting into our newly installed VM.

      FOG VM configuration

      Reboot and login to your FOG server VM. Ubuntu server installs extra packages we don’t need so lets update then get rid of them:

      $ sudo apt update && sudo apt upgrade
      $ sudo apt remove bcache-tools btrfs-progs cloud-guest-utils cloud-initramfs-copymods cloud-initramfs-dyn-netconf xfsprogs lxd-agent-loader open-iscsi open-vm-tools
      $ sudo apt autoremove
      

      Then we’ll download and extract the latest FOG release:

      $ wget https://github.com/FOGProject/fogproject/archive/1.5.9.tar.gz
      $ tar xvf 1.5.9.tar.gz
      

      This is a good point to create a snapshot of your VM should you mess any of the following steps up and need to start over.

      Running installfog.sh

      $ sudo ~/fogproject-1.5.9/bin/installfog.sh
      

      Then choose:

      Option 2 for Ubuntu packages
      N for Normal installation
      Don’t change the default network interface
      Say Yes to setting up a router address for the DHCP server then enter your gateway (‘router’ - in my case its 192.168.0.1)
      Say Yes to DHCP to handle DNS
      For What DNS address should DHCP allow? Accept the default
      Say Yes to Would you like to use the FOG server for DHCP service?
      Say no to the language packs unless you want them
      Say no to enabling HTTPS unless you want to configure that. I’m not covering that here.
      Don’t change the hostname if already set to fog-server

      The script will then download, install and configure the required packages. You will be required to click on a link or two to finish setting up the FOG database midway through the install script. Once the FOG install script has finished you can detach the host from the internet but still use FOG when its VM is running.

      posted in Tutorials
      D
      danboid

    Latest posts made by danboid

    • RE: Restore BIOS W10 image onto UEFI machine

      @george1421

      Yeah that’s what I expected. Thanks for the quick reply!

      posted in General
      D
      danboid
    • Restore BIOS W10 image onto UEFI machine

      First, why is there so little content on the FOG wiki FAQ page?

      https://wiki.fogproject.org/wiki/index.php/FAQ

      ?

      I think my question would be a good candidate for going on the FAQ page. If I have a sysprepped Windows 10 image took from a BIOS VM or physical machine, can I restore such an image onto a UEFI machine or can you only install BIOS images onto other BIOS machines?

      Thanks

      posted in General
      D
      danboid
    • RE: Linux mdraid RAID-10 with FOG?

      It seems it is possible to image mdadm/mdraid arrays using Clonezilla but you have to create the array manually to restore the image, if the array doesn’t already exist.

      https://sourceforge.net/p/clonezilla/discussion/Clonezilla_live/thread/447b64e1f2/

      posted in General
      D
      danboid
    • RE: Linux mdraid RAID-10 with FOG?

      Maybe I should’ve called it mdadm instead of mdraid?

      posted in General
      D
      danboid
    • RE: Linux mdraid RAID-10 with FOG?

      Sorry, I thought I was being specific by calling it mdraid, is that not its name? Its the all software RAID built into the Linux kernel, as configurable by the Ubuntu server installer etc.

      posted in General
      D
      danboid
    • Linux mdraid RAID-10 with FOG?

      I have read it should be possible to capture and deploy Linux images using Linux software mdraid here:

      https://forums.fogproject.org/topic/7882/capture-deploy-to-target-computers-using-intel-rapid-storage-onboard-raid

      Has anyone successfully captured and restored a Linux mdraid RAID-10 array using FOG? I have only read discussion on here of people capturing RAID-1 arrays.

      posted in General
      D
      danboid
    • Importing a partclone image, installing FOG service offline

      I have created a Windows VM under virt-manager/qemu and now I want the easiest/ most direct method to transfer this VM (after running sysprep on it) to my FOG server, which is on a different, isolated network.

      I would imagine the easiest/ most direct method would be to boot something like systemrescuecd on my VM then use partclone to make an image of my VM onto a samba share, running on the same machine as qemu in my case. I should hopefully then be able to copy this image into the correct dir on my FOG server and get it deployed but I haven’t found instructions on exactly how to do this, specifically:

      What partclone command should I use to image a single disk Windows 10 VM? Another thread on here suggests it would be something like:

      partclone.ntfs -fsck-src-part -c -s $part -O $fifoname -N -f 1

      I’m not sure what to use for $fifoname and then the real uncertain bit for me is what to do to get that imported into FOG correctly. I’m hoping it involves little more than registering a machine (without uploading an image) and then copying the partclone files into the correct dir?

      Failing that, I’ll be using clonezilla to image my VM before restoring that onto a physical machine and then importing that into FOG the usual way.

      Also, is it not possible to install the Windows FOG service without being connected to the same network as your FOG server? I tried all 4 of the Windows FOG service installers but they all gave the same error “Unable to install CA Certificate”

      posted in General Problems
      D
      danboid
    • RE: Configuring a standalone FOG VM under Ubuntu 20.04

      @george1421

      Hi George!

      Thanks for your feedback!

      1. I think I made this pretty clear in the first couple of paragraphs but I could add a bit more to say “note this is not the easiest way to install FOG”. I explain the reason for doing it in a VM in the second paragraph:

      “FOG and its required services (like DHCP and DNS servers) are things I don’t usually want to be running on my laptop or workstation which is why it’s useful to have FOG running inside of a VM so you can quickly fire it up as and when it’s needed.”

      The guide is titled “Configuring a standalone FOG VM” the VM bit being key here.

      1. Yes, I should definitely change it to use the git repo instead. Good suggestion.

      2. Thanks - useful advice

      3. Yes - that would be another good thing to highlight but I do mention the role of /images already

      I’m happy to make these changes but unfortunately the current forum settings don’t allow you to edit posts an hour after you’ve posted them. I just tried to edit the first post but I was denied. Could we ditch this rule please, at least for this post?

      posted in Tutorials
      D
      danboid
    • Configuring a standalone FOG VM under Ubuntu 20.04

      Configuring a standalone FOG VM under Ubuntu 20.04

      by Dan MacDonald

      FOG (Free Open Ghost) makes it quick and easy to deploy Windows, Linux or macOS images over a wired network using iPXE, partclone, apache and other open source software under the hood. The aim of this guide is to set up a FOG server running in a Ubuntu Server 20.04 VM hosted by qemu running on Ubuntu 20.04. I use virt-manager to simplify the process of creating and managing the VM.

      This server will be running its own DHCP and DNS servers so that all you will need is your FOG VM, a switch and some ethernet cables to image machines. FOG and its required services (like DHCP and DNS servers) are things I don’t usually want to be running on my laptop or workstation which is why it’s useful to have FOG running inside of a VM so you can quickly fire it up as and when it’s needed.

      User groups for virt-manager

      If you want to run virt-manager as a normal user, make sure your user is in both the kvm and libvirt groups. Remember you need to log out and back in after adding your user to a group before it takes effect.

      Create bridge interface on host machine

      When you install virt-manager a virbr0 network bridge is created but this doesn’t work to host a FOG server. Instead we need to create a bridge interface, br0, by editing /etc/netplan/01-network-manager-all.yaml to look like this:

      network:
        version: 2
        renderer: networkd
      
        ethernets:
          enp0s31f6:
            dhcp4: false
            dhcp6: false
      
        bridges:
          br0:
            interfaces: [enp0s31f6]
            addresses: [192.168.0.33/24]
            gateway4: 192.168.0.1
            mtu: 1500
            nameservers:
              addresses: [1.1.1.1]
            parameters:
              stp: true
              forward-delay: 4
            dhcp4: no
            dhcp6: no
      

      Make sure you at least modify enp0s31f6 above to match the wired interface name on your host machine - run ip l to list your network interfaces. You will need to reboot for the new network config to take effect.

      Note that using this netplan config will switch your Ubuntu box from using NetworkManager to using networkd, which is part of systemd. Whilst this will get FOG working, it also has the effect of breaking the network applets used by most Linux desktops because they nearly all use NM behind the scenes.

      It is possible to configure netplan to connect to wifi when using systemd but its not as simple as when using the NM applet. It is also possible to connect to wifi using wpasupplicant and wpa_gui whilst using networkd but I have not tested those with networkd yet. I’ll only be using the above networkd bridge config on my laptop when using FOG and use default Ubuntu NM config the rest of the time for easier wifi access.

      Create a FOG VM

      Download the Ubuntu Server 20.04 install image. Ubuntu 20.04 has the advantage over Debian 10 or RHEL 8 in that its kernel and qemu packages are recent enough to enable you to use Virtio-FS to share the hosts disk with the VM if your host supports NUMA. It is still possible to use Virtio-FS without NUMA but that requires qemu 5.x and Ubuntu 20.04 ships qemu 4.2.

      When creating the FOG VM in virt-manager, I assigned it 4 GB RAM and 4 VCPUs. You could get away with as little as 512 MB RAM, 1 VCPU and a 4 GB disk for your FOG VM and it should still run, if you don’t install any other software and you have the /images directory hosted elsewhere but generally you will want to make the VM disk as large as possible. You can easily use 200 GB imaging a modern Windows 10 box with a few big apps installed. On the last step of creating a new VM in virt-manager, for the Network selection I chose the option “Bridge br0: Host device enp0s31f6”.

      I find it easier to configure a static IP using the Ubuntu server installer so choose the Manual network configuration. For your FOG servers subnet you will likely want to use something like 192.168.0.0/24. I used 192.168.0.44 for the address, 1.1.1.1 for the nameserver and my gateway is 192.168.0.1. If you skipped the manual network config screen of the Ubuntu Server installer, you can alternately edit /etc/netplan/00-installer-config.yaml to look like this:

      network:
        ethernets:
          enp1s0:
            addresses:
            - 192.168.0.44/24
            gateway4: 192.168.0.1
            nameservers:
              addresses:
              - 1.1.1.1
        version: 2
      

      I used the Ubuntu server guided disk defaults, using the whole disk. It’s debatable how much use LVM is when used in VMs, its much easier to resize disks without it but its the default in Ubuntu server.

      On the Ubuntu server Profile Setup page, enter fog-server for the server name. Install the SSH server but don’t install any of the server snaps and cancel the updates at the end, we’ll update after booting into our newly installed VM.

      FOG VM configuration

      Reboot and login to your FOG server VM. Ubuntu server installs extra packages we don’t need so lets update then get rid of them:

      $ sudo apt update && sudo apt upgrade
      $ sudo apt remove bcache-tools btrfs-progs cloud-guest-utils cloud-initramfs-copymods cloud-initramfs-dyn-netconf xfsprogs lxd-agent-loader open-iscsi open-vm-tools
      $ sudo apt autoremove
      

      Then we’ll download and extract the latest FOG release:

      $ wget https://github.com/FOGProject/fogproject/archive/1.5.9.tar.gz
      $ tar xvf 1.5.9.tar.gz
      

      This is a good point to create a snapshot of your VM should you mess any of the following steps up and need to start over.

      Running installfog.sh

      $ sudo ~/fogproject-1.5.9/bin/installfog.sh
      

      Then choose:

      Option 2 for Ubuntu packages
      N for Normal installation
      Don’t change the default network interface
      Say Yes to setting up a router address for the DHCP server then enter your gateway (‘router’ - in my case its 192.168.0.1)
      Say Yes to DHCP to handle DNS
      For What DNS address should DHCP allow? Accept the default
      Say Yes to Would you like to use the FOG server for DHCP service?
      Say no to the language packs unless you want them
      Say no to enabling HTTPS unless you want to configure that. I’m not covering that here.
      Don’t change the hostname if already set to fog-server

      The script will then download, install and configure the required packages. You will be required to click on a link or two to finish setting up the FOG database midway through the install script. Once the FOG install script has finished you can detach the host from the internet but still use FOG when its VM is running.

      posted in Tutorials
      D
      danboid