domU

warning: Creating default object from empty value in /data/web/1/000/027/003/273448/htdocs/panticz.de/modules/taxonomy/taxonomy.pages.inc on line 33.

Create IPfire DomU (firewall)

Check for latest IPFire version
http://downloads.ipfire.org/

wget https://raw.githubusercontent.com/panticz/xen/master/domains/ipfire.sh -O - | bash -

#!/bin/bash

URL=http://downloads.ipfire.org/releases/ipfire-2.x/2.15-core79/ipfire-2.15.xen.i586-downloader-core79.tar.bz2

# download
wget -q ${URL} -O - | tar -C /tmp -xjf -
bash /tmp/ipfire/xen-image-maker.sh

# copy data to lvm
mkdir -p /tmp/ipfire/mnt/

# copy boot filesystem
lvcreate --name fw-boot --size 256M vg0
mkfs.ext2 /dev/vg0/fw-boot
#mount /tmp/ipfire/ipfire-boot.img /tmp/ipfire/mnt/ -o loop
mount ipfire-boot.img /tmp/ipfire/mnt/ -o loop
mount /dev/vg0/fw-boot /mnt/
cp -a  /tmp/ipfire/mnt/* /mnt/
umount /tmp/ipfire/mnt/
umount /mnt/

# copy root filesystem
lvcreate --name fw-root --size 2G vg0
mkfs.ext4 /dev/vg0/fw-root
#mount /tmp/ipfire/ipfire-root.img /tmp/ipfire/mnt/ -o loop
mount ipfire-root.img /tmp/ipfire/mnt/ -o loop
mount /dev/vg0/fw-root /mnt/
cp -a  /tmp/ipfire/mnt/* /mnt/
umount /tmp/ipfire/mnt/
umount /mnt/

# copy var filesystem
lvcreate --name fw-var --size 2G vg0
mkfs.ext4 /dev/vg0/fw-var
#mount /tmp/ipfire/ipfire-var.img /tmp/ipfire/mnt/ -o loop
mount ipfire-var.img /tmp/ipfire/mnt/ -o loop
mount /dev/vg0/fw-var /mnt/
cp -a  /tmp/ipfire/mnt/* /mnt/
umount /tmp/ipfire/mnt/
umount /mnt/

# create swap
lvcreate --name fw-swap --size 1G vg0
mkswap /dev/vg0/fw-swap


# clean up
rm -r /tmp/ipfire*

# create xen config file
cat <<EOF> /etc/xen/fw
bootloader = '/usr/lib/xen-4.1/bin/pygrub'
memory = 512
name = 'fw'
acpi = 1
apic = 1
vif = [ 'mac=00:17:4e:be:b1:ba' ]
disk = [
    'phy:/dev/vg0/fw-boot,xvda1,w',
    'phy:/dev/vg0/fw-swap,xvda2,w',
    'phy:/dev/vg0/fw-root,xvda3,w',
    'phy:/dev/vg0/fw-var,xvda4,w'
]
pci = ['00:0c.0']
extra = 'iommu=soft'
EOF

# OPTIONAL: autostart
ln -s /etc/xen/fw /etc/xen/auto/01_fw

# TODO (automate)
rmmod e100
rmmod xen-pciback
modprobe xen-pciback 'hide=(00:0c.0)'
xm pci-list-assignable-devices

# start domU
xm create -c fw

# OPTIONAL
sed -i 's|phy:/dev/vg0/fw-|file:/root/ipfire-|g' /etc/xen/fw
sed -i 's|,xvda|.img,xvda|g' /etc/xen/fw

# configure ipfire in terminal

# webinterface
https://YOUR_DOMU_IP:444

# Links
http://wiki.ipfire.org/de/addons/virtualisation/howto/debian_wheezy_xen_4.1?&#debian_wheezy_mit_xen_41_als_dom0
http://wiki.ipfire.org/de/addons/virtualisation/howto/debian_als_dom0_xen#xen_und_kernel_installieren
http://wiki.ipfire.org/de/addons/virtualisation/howto/debian_xen_4.x

CentOS DomU under Debian Lenny Dom0

# new
http://www.panticz.de/DomU-CentOS-6
 
# xen-create-image + rinse
# http://serverfault.com/questions/347881/how-to-create-a-centos-xen-domu-on-debian-squeeze-using-xen-create-image
xen-create-image --hostname=foo.example.com --ip=1.2.3.4 --gateway=1.2.3.1 --netmask=255.255.255.0 --install-method=rinse --dist=centos-6 --mirror=http://mirror.centos.org/centos/5/os/x86_64/CentOS/ --arch=amd64 --lvm=vg0
 
xm create -c /etc/xen/foo.example.com.cfg
 
#
# OLD
#
 
# configure domU
DOMAIN_NAME=cenos6
DOMAIN_MAC=00:12:11:21:aa:bb
DOMAIN_RAM=1Gb
DOMAIN_HDD=8Gb
 
# create domU on LVM

x2go domU

# set domU parameter
[ -z $DOMAIN_NAME ] && DOMAIN_NAME=x2go
[ -z $DOMAIN_MAC ] && DOMAIN_MAC=00:00:00:a0:b0:c0
[ -z $DOMAIN_RAM ] && DOMAIN_RAM=1Gb
[ -z $DOMAIN_HDD ] && DOMAIN_HDD=8Gb
 
# create domU
http://www.panticz.de/Xen-domU-ubuntu-jaunty
or
http://www.panticz.de/Ubuntu-Karmic-domU-under-Debian-Lenny-Dom0
 
# add to autostart (optional)
ln -s /etc/xen/${DOMAIN_NAME} /etc/xen/auto
 
# start domU
xm create -c ${DOMAIN_NAME}
 
# old # apt-get install gnome-desktop-environment
apt-get install debconf-utils
 
 
 
apt-get -y install ubuntu-desktop
 
 
# new
gpg --keyserver
Syndicate content