Fedora-23 installation in VM image

Steps to install Fedora-23 in VM image

Target:on the VM image, we can make gcc32bit and gcc64bit build.

Set up a bridge on host

We need set up a bridge on the interface which connect to internet, then attach a tap device(VM) to the bridge, so that VM can connect to internet to download software and package.

How to set up bridge

Create virtual machine and install OS

1. Download OS version (*.iso file) from website. For some, you can get from: http://linux-ftp.jf..com/pub/mirrors. For others, you need to get from its official website.

2. Use WinSCP to copy the *.iso file to host. I put the iso to /home/img/

3. Allocate memory for VM image

qemu-img create –f qcow2 f23.img 20G

(The current directory is /home/osimg/)

4. Install guest OS from ISO to VM image using qemu

qemu-system-x86_64 -enable-kvm -m 2048 -cdrom /home/img/Fedora-Server-DVD-x86_64-23.iso -boot d -drive file=/home/osimg/f23.img \
-vnc :10 -daemonize

5. Open Xming, install OS from vncviewer.

vncviewer :10

Select the default step by step for the OS installation. Then reboot. If it leads you to reinstall the OS, kill the procedure

ps -ef |grep qemu
kill -9 <the number of the procedure>

Set VM

1. Edit a script file to start VM.

vim f23-start.sh

Add a tap to connect the VM and internet

#!/bin/sh
qemu-system-x86_64 -mem-path /mnt/huge -mem-prealloc -enable-kvm -m 2048 -smp cores=2,sockets=1 -cpu host -name dpdk1-f23 -drive file=/home/osimg/f23.img -netdev tap,id=ipvm1,ifname=tap3,script=/etc/qemu-ifup -device rtl8139,netdev=ipvm1,id=net0,mac=00:00:00:00:00:01 -localtime -vnc :10 –daemonize

2. Add execute permission and run the script

chmod +x f23-start.sh
./f23-start.sh

3. Login the VM with VNC, check the IP address

vncviewer :10
ifconfig

3.1 When you get the IP address you can access to VM by SSH

Note: Fedora20 and before versions are graphical interface, if you want to get IP address, you need operate as follows:

Activities --> Type to search(input “IP”) --> Network

Then you can see the IP address.

3.2 Allocate an IP address manually If there is not IP address allocated automatically, you can assign a IP address manually.

dhclient

If there is still not IP address allocated, you must set the IP address/netmask and gateway:

ifconfig ethx 0.0.0.0 netmask 255.255.255.0
route add default gw 0.0.0.1<code>

4. When the VM has IP but can’t be connected, the reason may be firewall and proxy

Close the firewall:

<code>systemctl disable firewalld.service
systemctl stop firewalld.service

5. Optional settings

5.1 Set hostname

nmcli general hostname stv-vm-f23.sh.intel.com

Then check the hostname

[[email protected] ~]# hostname
stv-vm-f23.sh.intel.com

Note: The command can work only on fedora21/22/23. On fedora20 and before you must configure hostname by ifcfg file.

5.2 Check the status of ssh

systemctl show sshd

You can see the following information:

Description=OpenSSH server daemon
LoadState=loaded
ActiveState=active
SubState=running
UnitFileState=enabled

It means no need to do extra operations.

Else, you may install and enable ssh manully.

yum install openssh
systemctl enable sshd.service
systemctl restart sshd.service

原文地址:https://www.cnblogs.com/lusix/p/9186177.html

时间: 2024-10-17 21:48:49

Fedora-23 installation in VM image的相关文章

Fedora 23如何安装LAMP服务器

LAMP 是开源系统上 Web 服务器的梦幻组合.LAMP 是 Linux. Apache HTTP 服务. MySQL/MariaDB 数据库和 PHP. Perl 或 Python 的简称. 下面教你如何在 Fedora 23 服务器上安装 LAMP 组合. 下面的教程默认使用 192.168.1.102/24 实例,请按照你的服务器做修改. 安装 Apache Apache 是一款开源的 web 服务框架.完全支持 CGI, SSL. 切换到 root 账户: su Fedora 23/2

Fedora 23+CUDA 8.0+ GTX970 安装

https://www.if-not-true-then-false.com/2015/fedora-nvidia-guide/ PRE-INSTALLATION ACTIONS Some actions must be taken before the CUDA Toolkit and Driver can be installed onLinux:? Verify the system has a CUDA-capable GPU.? Verify the system is running

Fedora 23/RHEL7网络配置和DNS服务器的搭建

Fedora 是一个Linux的发行版,Fedora (第七版以前为Fedora Core)是一款基于 Linux ,从Red Hat Linux发展出来的免费操作系统,Fedora在2015年11月3日已更新到第23版Fedora 23.而红帽的Red Hat Enterprise Linux 7(简称RHEL7)对应的Fedora版本,则是从Fedora 19开始.目前RHEL系列已更新到RHEL7.2. Fedora 是一款由全球社区爱好者构建的面向日常应用的快速.稳定.强大的操作系统.它

Fedora 23 系统安装

[1]Download Fedora 23 ( released on 03 November, 2015 ) from the following site. ? http://download.fedoraproject.org/pub/fedora/linux/releases/23/Server/x86_64/iso/ It's OK to download 64 bit version generally. But if your computer is very old and no

在树莓派2代B型/3代 上安装Fedora23 - Installing Fedora 23 on Raspberry Pi 2 model B or Raspberry Pi 3

本文主要用于记录安装过程,以便日后查阅回顾. 之前在自己的树莓派上运行的一直是通过NOOB安装的Raspbian,但是本人平时更喜欢用Fedora作为开发和使用环境,而且Raspbian上的软件包通常更新比较缓慢.因为树莓派2代B型上市前,树莓派的芯片都是armv6或者更早的架构,只能运行ARM架构的Raspbian或者Fedora 18及更早版本.树莓派2代B型搭载的芯片架构是armv7,树莓派3代搭载的芯片架构是armv8,这两种芯片都能够运行ARM架构的Fedora 23,而仅运行Rasp

在Fedora 23 Server和Workstation上安装LAMP(Linux, Apache, MariaDB和PHP)

在安装LAMP之前,建议先更新系统包$ sudo dnf update 第一步:安装Apache Web服务器1.在Fedora 23安装Apache,你可以运行下面的命令:$ sudo dnf install httpd2.安装完成后,我们设置在系统启动时自动启动Apache,然后我们将开始验证Apache的状态.运行以下一系列的命令:$ sudo systemctl enable httpd.service$ sudo systemctl start httpd$ sudo systemct

Fedora 23 U盘启动出现“Failed to load ldlinux.c32”解决

利用UltraISO制作了Fedora 23的U盘启动,开机F12键USB启动时出现 Failed to load ldlinux.c32 Boot failed: please change disks and press a key to continue 在网上查询很多,进行了多次尝试: 换一个其他软件制作U盘启动,尝试失败 认为下载系统软件有问题,下载了其他版本的Fedora 21/25,顺利安装 猜测是不是制作启动时写入方式有问题,尝试了多个写入方式(USB-HDD.USB-HDD+.

Fedora 23 U盘启动出现“Failed to load ldlinux.c32”解决 ZT

利用UltraISO制作了Fedora 23的U盘启动,开机F12键USB启动时出现 1 2 Failed to load ldlinux.c32 Boot failed: please change disks and press a key to continue 在网上查询很多,进行了多次尝试: 换一个其他软件制作U盘启动,尝试失败 认为下载系统软件有问题,下载了其他版本的Fedora 21/25,顺利安装 猜测是不是制作启动时写入方式有问题,尝试了多个写入方式(USB-HDD.USB-H

VirtualBox 5.0.10 中 Fedora 23 在安装了增强工具后无法自动调节虚拟机分辨率的问题

VirtualBox 5.0.10 中安装 Fedora 23,即使在安装了增强工具后,仍然会发现虚拟机无法根据 VirtualBox 的运行窗口大小自动进行分辨率调节.究其原因,主要是因为 Fedora 23 所带的 Xorg 显示服务器的版本过高,目前 VirtualBox 5.0.10 尚未支持.解决办法有两个: 1.等待 VirtualBox 升级新版本,提供对最新版 Xorg 的支持. 2.将 Fedora 23 自带的 Xorg 软件包版本降级为 Fedora 22 所带版本,这样就

给Fedora 23 添加上交大学的源

在目录/etc/yum.repo.d下  (etc目录下所有带.d的目录都是用户自己可以配置文件的地方) touch down_sjtu.repo #创建一个文件,名字可以任意,但是必须是.repo后缀 gedit down_sjtu.repo [name] name=Fedora 23 -x86_64 baseurl=http://ftp.sjtu.edu.cn/fedora/linux/releases/23/Server/x86_64/os/ ##这个目录可以直接打开,可以看到这一级目录文