LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Virtualization and Cloud
User Name
Password
Linux - Virtualization and Cloud This forum is for the discussion of all topics relating to Linux Virtualization and Linux Cloud platforms. Xen, KVM, OpenVZ, VirtualBox, VMware, Linux-VServer and all other Linux Virtualization platforms are welcome. OpenStack, CloudStack, ownCloud, Cloud Foundry, Eucalyptus, Nimbus, OpenNebula and all other Linux Cloud platforms are welcome. Note that questions relating solely to non-Linux OS's should be asked in the General forum.

Notices


Reply
  Search this Thread
Old 04-03-2013, 12:02 PM   #1
juniorb0y007
LQ Newbie
 
Registered: Mar 2013
Posts: 8

Rep: Reputation: Disabled
Creating a linux image on the server homework


Hello all,

I have been editing this script my teacher provided me. I have been getting errors after I ran the script to an image on the server.

here is the script:
#!/bin/bash
GUESTIMAGESTORAGE=/home/wahab/Desktop/linux
GUESTIMAGEFORMAT=qcow2
ISOSTORAGE=/home/wahab/Desktop/iso
ISOFILENAME=SL-63-x86_64-2012-08-02-Install-DVD.iso
NETWORKBRIDGE=guest_os_bridge
KICKSTARTFILEPATH=/home/wahab/Desktop/kickstart
GUESTRAM=1024
GUESTDISKSIZE=4
REPO64=http://ftp1.scientificlinux.org/linux/scientific/6.3/x86_64/os
GUESTNAME64=sl63x86_64_wgul
KICKSTARTFILENAME64=sl63x86_64_ks_base.cfg
KICKSTARTFILELOCATION64=$KICKSTARTFILEPATH/$KICKSTARTFILENAME64
echo "$KICKSTARTFILELOCATION64"
# Create images directory
mkdir -p /home/wahab/Desktop/iso
mkdir -p /home/wahab/Desktop/kickstart
mkdir -p $GUESTIMAGESTORAGE
cp /root/install/$KICKSTARTFILENAME64 $KICKSTARTFILEPATH/$KICKSTARTFILENAME64
virt-install --connect qemu:///system \
--name $GUESTNAME64 \
--ram $GUESTRAM \
--vcpus=1 \
--file $GUESTIMAGESTORAGE/$GUESTNAME64$(echo ".")$GUESTIMAGEFORMAT \
--file-size $GUESTDISKSIZE \
--location $REPO64 \
--vnc \
--noautoconsole \
--os-type linux \
--accelerate \
--network=bridge:$NETWORKBRIDGE,mac=00:00:00:00:00:00 \
--hvm \
--initrd-inject=$KICKSTARTFILELOCATION64 \
--extra-args "ks=file:/$KICKSTARTFILENAME64"
#

Error Message I am getting after running the script:
[root@localhost Desktop]# bash sample_create-1.sh
/home/wahab/Desktop/kickstart/sl63x86_64_ks_base.cfg

Starting install...
Retrieving file .treeinfo... | 768 B 00:00 ...
Retrieving file vmlinuz... | 7.6 MB 00:04 ...
Retrieving file initrd.img... | 60 MB 00:30 ...
ERROR internal error Process exited while reading console log output: char device redirected to /dev/pts/5
qemu-kvm: -drive file=/home/wahab/Desktop/linux/sl63x86_64_wgul.qcow2,if=none,id=drive-ide0-0-0,format=raw,cache=none: could not open disk image /home/wahab/Desktop/linux/sl63x86_64_wgul.qcow2: Permission denied

Domain installation does not appear to have been successful.
If it was, you can restart your domain by running:
virsh --connect qemu:///system start sl63x86_64_wgul
otherwise, please restart your installation.
[root@localhost Desktop]#


I have give files chmod 777 permision, but i am still getting this error. Please help explaining where is the problem.
 
Old 04-03-2013, 12:27 PM   #2
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,623

Rep: Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651
hi there
first you might want to use the "code" tags when posting
PHP Code:
[code]the code you copy/pasted [/code
so it looks like this -- it is a lot easier to read
Code:
#!/bin/bash
GUESTIMAGESTORAGE=/home/wahab/Desktop/linux
GUESTIMAGEFORMAT=qcow2
ISOSTORAGE=/home/wahab/Desktop/iso
ISOFILENAME=SL-63-x86_64-2012-08-02-Install-DVD.iso
NETWORKBRIDGE=guest_os_bridge
KICKSTARTFILEPATH=/home/wahab/Desktop/kickstart
GUESTRAM=1024
GUESTDISKSIZE=4
REPO64=http://ftp1.scientificlinux.org/linux/scientific/6.3/x86_64/os
GUESTNAME64=sl63x86_64_wgul
KICKSTARTFILENAME64=sl63x86_64_ks_base.cfg
KICKSTARTFILELOCATION64=$KICKSTARTFILEPATH/$KICKSTARTFILENAME64
echo "$KICKSTARTFILELOCATION64"
# Create images directory
mkdir -p /home/wahab/Desktop/iso
mkdir -p /home/wahab/Desktop/kickstart
mkdir -p $GUESTIMAGESTORAGE
cp /root/install/$KICKSTARTFILENAME64 $KICKSTARTFILEPATH/$KICKSTARTFILENAME64
virt-install --connect qemu:///system \
--name $GUESTNAME64 \
--ram $GUESTRAM \
--vcpus=1 \
--file $GUESTIMAGESTORAGE/$GUESTNAME64$(echo ".")$GUESTIMAGEFORMAT \
--file-size $GUESTDISKSIZE \
--location $REPO64 \
--vnc \
--noautoconsole \
--os-type linux \
--accelerate \
--network=bridge:$NETWORKBRIDGE,mac=00:00:00:00:00:00 \
--hvm \
--initrd-inject=$KICKSTARTFILELOCATION64 \
--extra-args "ks=file:/$KICKSTARTFILENAME64"
Quote:
I have give files chmod 777 permision, but i am still getting this error. Please help explaining where is the problem.
using chmod with "777" on system files is likely to cause the operating system to not boot

or if folders in your home like "Desktop"
you might not even be able to login as that user

most OS's check if the "system files" have the correct permissions and if NOT then NOT BOOT
this is a safety precaution

and SELinux REALLY checks things ,and if the SE context is not correct it will not run

also this
Quote:
/home/wahab/Desktop/linux/sl63x86_64_wgul.qcow2
linux is not Windows
the "Desktop" folder is a special case folder
keeping programs there can cause problems , like they might not work

"sl63x86_64"
so this is ScientificLinux 6.3 you have
SELinux can also cause problems if you use the "Desktop" folder

-- linux is not windows --
so please do not try to fill up the "desktop " with 1,000+ "installers"

there should be a folder in your home folder called "public"
that is in the system $PATH for your normal user

Last edited by John VV; 04-03-2013 at 12:41 PM.
 
Old 04-03-2013, 01:14 PM   #3
juniorb0y007
LQ Newbie
 
Registered: Mar 2013
Posts: 8

Original Poster
Rep: Reputation: Disabled
Script

Quote:
Originally Posted by John VV View Post
hi there
first you might want to use the "code" tags when posting
PHP Code:
[code]the code you copy/pasted [/code
so it looks like this -- it is a lot easier to read
Code:
#!/bin/bash
GUESTIMAGESTORAGE=/home/wahab/Desktop/linux
GUESTIMAGEFORMAT=qcow2
ISOSTORAGE=/home/wahab/Desktop/iso
ISOFILENAME=SL-63-x86_64-2012-08-02-Install-DVD.iso
NETWORKBRIDGE=guest_os_bridge
KICKSTARTFILEPATH=/home/wahab/Desktop/kickstart
GUESTRAM=1024
GUESTDISKSIZE=4
REPO64=http://ftp1.scientificlinux.org/linux/scientific/6.3/x86_64/os
GUESTNAME64=sl63x86_64_wgul
KICKSTARTFILENAME64=sl63x86_64_ks_base.cfg
KICKSTARTFILELOCATION64=$KICKSTARTFILEPATH/$KICKSTARTFILENAME64
echo "$KICKSTARTFILELOCATION64"
# Create images directory
mkdir -p /home/wahab/Desktop/iso
mkdir -p /home/wahab/Desktop/kickstart
mkdir -p $GUESTIMAGESTORAGE
cp /root/install/$KICKSTARTFILENAME64 $KICKSTARTFILEPATH/$KICKSTARTFILENAME64
virt-install --connect qemu:///system \
--name $GUESTNAME64 \
--ram $GUESTRAM \
--vcpus=1 \
--file $GUESTIMAGESTORAGE/$GUESTNAME64$(echo ".")$GUESTIMAGEFORMAT \
--file-size $GUESTDISKSIZE \
--location $REPO64 \
--vnc \
--noautoconsole \
--os-type linux \
--accelerate \
--network=bridge:$NETWORKBRIDGE,mac=00:00:00:00:00:00 \
--hvm \
--initrd-inject=$KICKSTARTFILELOCATION64 \
--extra-args "ks=file:/$KICKSTARTFILENAME64"

using chmod with "777" on system files is likely to cause the operating system to not boot

or if folders in your home like "Desktop"
you might not even be able to login as that user

most OS's check if the "system files" have the correct permissions and if NOT then NOT BOOT
this is a safety precaution

and SELinux REALLY checks things ,and if the SE context is not correct it will not run

also this

linux is not Windows
the "Desktop" folder is a special case folder
keeping programs there can cause problems , like they might not work

"sl63x86_64"
so this is ScientificLinux 6.3 you have
SELinux can also cause problems if you use the "Desktop" folder

-- linux is not windows --
so please do not try to fill up the "desktop " with 1,000+ "installers"

there should be a folder in your home folder called "public"
that is in the system $PATH for your normal user

thank you very much for your help. I have moved the data from Desktop to Public folder. I am still getting this error.
PHP Code:
[code]  [root@localhost Public]# bash sample_create-1.sh 
/home/wahab/Public/kickstart/sl63x86_64_ks_base.cfg

Starting install
...
Retrieving file .treeinfo...                             |  768 B     00:00 ... 
Retrieving file vmlinuz...                               | 7.6 MB     00:05 ... 
Retrieving file initrd.img...                            |  60 MB     00:30 ... 
ERROR    internal error Process exited while reading console log outputchar device redirected to /dev/pts/7
qemu
-kvm: -drive file=/home/wahab/Public/linux/sl63x86_64_wgul.qcow2,if=none,id=drive-ide0-0-0,format=raw,cache=nonecould not open disk image /home/wahab/Public/linux/sl63x86_64_wgul.qcow2Permission denied

Domain installation does not appear to have been successful
.
If 
it wasyou can restart your domain by running:
  
virsh --connect qemu:///system start sl63x86_64_wgul
otherwiseplease restart your installation.
[
root@localhost Public]

              
[/code

Last edited by juniorb0y007; 04-03-2013 at 01:18 PM.
 
Old 04-03-2013, 01:33 PM   #4
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,623

Rep: Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651
being "homework"

you might want to re go over the section in your textbook
paragraph by paragraph to look for what you missed on moving a VM image from one VM to another
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Error while creating image of linux server by GHOST for linux sw manish_meet_in Linux - Software 3 05-08-2006 09:39 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Virtualization and Cloud

All times are GMT -5. The time now is 04:34 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration