Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

[Tutorial] Install CentOS 7 remotely through VNC

edanedan Member
edited March 2016 in Tutorials

This tuts inspired by the WSI $10 box with free extra 250GB HDD. Some of you perhaps want to setup soft RAID 1 on CentOS 7 and here are the step to achieve that by installing it via VNC.

Boot options between CentOS 6 and CentOS 7 for VNC installatons are different now, you can read it on RedHat.

Download the bootstrap files

yum install wget
cd /boot
wget http://mirror.centos.org/centos/7/os/x86_64/isolinux/vmlinuz -O vmlinuz-7
wget http://mirror.centos.org/centos/7/os/x86_64/isolinux/initrd.img -O initrd-7.img

Creating custom menu entry

The safest thing is we just need to copy menu entry that already exists in /boot/grub2/grub.cfg.

Example existing menu entry:

menuentry 'CentOS Linux, with Linux 3.10.0-123.el7.x86_64' --class centos --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-3.10.0-123.el7.x86_64-advanced-ac9e46e0-6de5-4e6f-baf2-cca39dffe49b' {
    load_video
    set gfxpayload=keep
    insmod gzio
    insmod part_msdos
    insmod ext2
    set root='hd0,msdos1'
    if [ x$feature_platform_search_hint = xy ]; then
      search --no-floppy --fs-uuid --set=root --hint='hd0,msdos1'  ac9e46e0-6de5-4e6f-baf2-cca39dffe49b
    else
      search --no-floppy --fs-uuid --set=root ac9e46e0-6de5-4e6f-baf2-cca39dffe49b
    fi
    linux16 /vmlinuz-3.10.0-123.el7.x86_64 root=UUID=ac9e46e0-6de5-4e6f-baf2-cca39dffe49b ro vconsole.keymap=us crashkernel=auto  vconsole.font=latarcyrheb-sun16 rhgb quiet LANG=en_US.UTF-8
    initrd16 /initramfs-3.10.0-123.el7.x86_64.img
}

And than paste it to /etc/grub.d/40_custom. Modify the menu entry title, the linux16, initrd16..


#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.

menuentry 'NetInstall' {
    load_video
    set gfxpayload=keep
    insmod gzio
    insmod part_msdos
    insmod ext2
    set root='hd0,msdos1'
    if [ x$feature_platform_search_hint = xy ]; then
      search --no-floppy --fs-uuid --set=root --hint='hd0,msdos1'  ac9e46e0-6de5-4e6f-baf2-cca39dffe49b
    else
      search --no-floppy --fs-uuid --set=root ac9e46e0-6de5-4e6f-baf2-cca39dffe49b
    fi
    linux16 /vmlinuz-7 inst.vnc inst.vncpassword=12345678 inst.headless ip=ip::gateway:netmask::interface:none nameserver=8.8.8.8 inst.repo=http://mirror.centos.org/centos/7/os/x86_64/ inst.lang=en_US inst.keymap=us
    initrd16 /initrd-7.img
}

Note: replace the ip=ip::gateway:netmask::interface:none with yours. eg:

ip=10.0.0.10::10.0.0.1:255.255.255.0::eth0:none

Make sure to set the right network device.

VNC Password length

MUST between 6-8 char.

Grub configurations

Make sure it only boot our custom menu entry once. In /etc/default/grub, change GRUB_DEFAULT=0 to GRUB_DEFAULT=saved

GRUB_DEFAULT=saved

Save all the configurations.

# rebuilt the grub.cfg

grub2-mkconfig -o /boot/grub2/grub.cfg

# list available menu entry

awk -F\' '$1=="menuentry " {print $2}' /etc/grub2.cfg

# verify the default menu entry

grub2-editenv list

# set the default boot (do this if the default menu entry changed)

grub2-set-default 'CentOS Linux, with Linux 3.10.0-123.el7.x86_64'

# boot our new menu entry for the next reboot. We just need to use the menu entry title.

grub2-reboot NetInstall

Double check your current configurations before rebooting your server.

Wait a moments until the setup finished. You can starting your CentOS 7 remote installatons at YOURIP:1 by using VNC. [Source]

Thanked by 1sin
Sign In or Register to comment.