Running ASReml on Linux
To run ASReml on a Linux system can be very tricky. This software has built its reputation. It then don’t care very much about its custormers. The following valid instructions were after many combination tests. Had you any other alternatives, I would not recommend ASReml, especially on Linux, where most serious computations are carried on nowadays.
The following instructions are to run a cloud instance of AlmaLinux9 one a AlmaLinux 10 system.
AlmaLinux 9 Cloud Image Setup (Alma 10 Host)
Summary of the successful steps to provision an AlmaLinux 9 VM using
virt-install and cloud-init.
1. Prerequisites
Ensure virtualization tools are installed and the default network is active:
sudo dnf install -y virt-install libvirt qemu-img libguestfs-tools
sudo systemctl enable --now libvirtd
sudo virsh net-start default
2. Prepare the Image
# Download image
curl -O https://repo.almalinux.org/almalinux/9/cloud/x86_64/images/AlmaLinux-9-GenericCloud-latest.x86_64.qcow2
# Move to storage and resize
sudo mv AlmaLinux-9-GenericCloud-latest.x86_64.qcow2 /var/lib/libvirt/images/almalinux9.qcow2
sudo qemu-img resize /var/lib/libvirt/images/almalinux9.qcow2 20G
3. Create Cloud-Init Configuration
Create a user-data file. Note: Use the correct public key path
(e.g., id_ed25519.pub or id_rsa.pub).
#cloud-config
ssh_pwauth: True
users:
- name: almalinux
sudo: ALL=(ALL) NOPASSWD:ALL
lock_passwd: false
ssh_authorized_keys:
- ssh-ed25519 AAA... (paste your .pub key here)
4. Provision VM
sudo virt-install
--name alma9
--memory 12288
--vcpus 4
--os-variant almalinux9
--disk path=/var/lib/libvirt/images/almalinux9.qcow2,format=qcow2
--import
--network network=default
--cloud-init user-data=user-data
--graphics none
--noautoconsole
5. Accessing the VM
From the Host Machine
Find the IP and SSH in:
sudo virsh net-dhcp-leases default
ssh almalinux@<VM_IP>
From Another Machine (Remote Access)
Since the VM is on a private bridge (192.168.122.x), it is not
directly reachable from your local network. Use one of these methods:
Method A: SSH Jump/Proxy (Easiest)
Use the host machine as a gateway. This can also be configured in your
.ssh/config:
ssh -J user@host-ip almalinux@<VM_IP>
Install R on the VM
#!/bin/bash
# Install R4.2.3 may cause trouble to install `ASRgenomics`
# So I removed the R4.2.3 part
# R 4.2.3 Installation Script for AlmaLinux 9
# Based on Posit's pre-compiled binaries
set -e
echo "Enabling EPEL and CRB repositories..."
sudo dnf install -y epel-release
sudo dnf install -y dnf-plugins-core
sudo dnf config-manager --set-enabled crb
#export R_VERSION=4.2.3
#echo "Installing R ${R_VERSION}..."
#sudo dnf install -y https://cdn.posit.co/r/rhel-9/pkgs/R-${R_VERSION}-1-1.x86_64.rpm
echo "Installing R ..."
sudo dnf install R # R 4.5
echo "Verifying installation..."
#/opt/R/${R_VERSION}/bin/R --version
#echo "Creating symbolic links to /usr/local/bin..."
#sudo ln -sf /opt/R/${R_VERSION}/bin/R /usr/local/bin/R
#sudo ln -sf /opt/R/${R_VERSION}/bin/Rscript /usr/local/bin/Rscript
echo "R installation complete."
Install ASReml-R
Before start R
- Download ASReml 4.3 for R 4,5 for Rocky Linux 9 64-bit.
- Copy your VSNi directory into your VM home. This file was created during your initial unsuccessful installation.
Start R:
install.packages(c("data.table", "ggplot2", "jsonlite"))
install.packages("path/to/asreml_4.2.0.393_R_x86_64-pc-linux-gnu.tar.gz")
Configure license server route
I had trouble with the license server. ASReml needs to contact the Reprise License Management (RLM) server through port 5053.
sudo ufw status # => inactiave
showing that the port is not blocked by the local computer.
nc -zv ls34.rlmcloud.com 5053 # with wired network
# Ncat: TIMEOUT.
nc -zv ls34.rlmcloud.com 5053 # with eduroam
# Ncat: Connected to 54.183.111.138:5053.
# Ncat: 0 bytes sent, 0 bytes received in 0.19 seconds.
confirmed that the port is not open for the wired net at campus level.
Solution
To temporarily force the license request go through eduroam:
sudo ip route add 54.183.111.138 via 10.42.32.1 dev wlo1
To permanently add the route:
nmcli connection show # to find the wifi/eduroam name
sudo nmcli connection modify eduroam +ipv4.routes "54.183.111.138/32 10.42.32.1"
sudo nmcli connection down eduroam && sudo nmcli connection up eduroam
Test ASReml-R
Run the following R script:
# asreml-r basic test script
library(asreml)
# 1. Generate a small simulated dataset
set.seed(42)
n <- 100
data <- data.frame(
Yield = rnorm(n, mean = 50, sd = 10),
Variety = factor(sample(paste0("V", 1:5), n, replace = TRUE)),
Block = factor(sample(paste0("B", 1:4), n, replace = TRUE))
)
# 2. Fit a basic linear mixed model
# Fixed effect: Variety
# Random effect: Block
cat("Fitting model...
")
model <- asreml(
fixed = Yield ~ Variety,
random = ~ Block,
data = data
)
# 3. Print results
cat("
--- Variance Components ---
")
print(summary(model)$varcomp)
cat("
--- Wald Test for Fixed Effects ---
")
print(wald(model))
cat("
ASReml-R test complete.
")