Bug 553877

Summary: LXC: No $TERM variable set for containers
Product: [Fedora] Fedora Reporter: Robin Green <greenrd>
Component: libvirtAssignee: Libvirt Maintainers <libvirt-maint>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 14CC: berrange, clalance, crobinso, itamar, jforbes, veillard, virt-maint
Target Milestone: ---   
Target Release: ---   
Hardware: i686   
OS: Linux   
URL: http://dev.exherbo.org/stages/exherbo-x86-20091215.tar.xz
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-01-24 16:46:12 EST Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
Attachments:
Description Flags
VM definition file none

Description Robin Green 2010-01-09 03:28:27 EST
Created attachment 382616 [details]
VM definition file

Description of problem:
In my LXC VM, vi doesn't update the display properly when I'm using virsh console.

Version-Release number of selected component (if applicable):
libvirt-client-0.7.1-15.fc12.i686

How reproducible:
Always (though I only tried reproducing from step 8)

Steps to Reproduce:
1. ssh server
2. download Exherbo Linux distribution stage image from URL above
3. become root
4. mkdir exherbo;cd exherbo;tar xfJ ../exherbo-x86-20091215.tar.xz
5. download attached .xml file and adjust path according to where you untarred the .tar.xz file
6. virsh --connect lxc:/// define exherbo.xml
7. virsh --connect lxc:/// start exherbo
8. virsh --connect lxc:/// console exherbo
9. vi /etc/fstab
10. Press 'i' to enter insert mode (this is only way I know how to use vi, so that's what I did!)
11. Hit the cursor down key repeatedly until you start scrolling
  
Actual results:
Display corrupted

Expected results:
Display not corrupted; normal scrolling

Additional info:
The TERM environment variable is unset inside the virsh console.
Comment 1 Robin Green 2010-01-09 03:39:02 EST
Also, the console doesn't get redisplayed when you connect to it via virsh console.

Re the original bug, I can see that it's difficult to set the TERM correctly on startup since you don't know what TERM will be used in future, and it's impossible to set it when you run virsh console.

Maybe somehow integrating GNU screen (or a similar program) into the virsh console mechanism for LXC would address both of these problems?
Comment 2 Bug Zapper 2010-11-03 21:28:49 EDT
This message is a reminder that Fedora 12 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 12.  It is Fedora's policy to close all
bug reports from releases that are no longer maintained.  At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '12'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 12's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 12 is end of life.  If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping
Comment 3 Daniel Berrange 2010-11-04 13:46:45 EDT
libvirt could probably set an initial  TERM=vt100  env variable when creating the container. The container OS could then override this if desired.
Comment 4 Daniel Berrange 2011-02-23 07:06:52 EST
Upstream includes TERM=linux in containers by default now:

http://libvirt.org/git/?p=libvirt.git;a=commitdiff;h=b70a1f455cacd847a8f00b276bc59e433ae2a651
Comment 5 Fedora Admin XMLRPC Client 2011-09-22 13:59:51 EDT
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.
Comment 6 Fedora Admin XMLRPC Client 2011-09-22 14:04:01 EDT
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.
Comment 7 Fedora Admin XMLRPC Client 2011-11-30 15:00:11 EST
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.
Comment 8 Fedora Admin XMLRPC Client 2011-11-30 15:00:43 EST
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.
Comment 9 Fedora Admin XMLRPC Client 2011-11-30 15:05:53 EST
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.
Comment 10 Fedora Admin XMLRPC Client 2011-11-30 15:05:59 EST
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.
Comment 11 Cole Robinson 2012-01-24 16:46:12 EST
F14 is EOL, please reopen if this is still relevant in a more recent fedora.